13.3.3. Install the mod_cluster Module Into Apache HTTPD or Enterprise Web Server HTTPD
- To perform this task, you must be using Apache HTTPD installed in Red Hat Enterprise Linux 6, or JBoss Enterprise Web Server, or the stand-alone HTTPD included as a separate downloadable component of JBoss Enterprise Application Platform 6.
- If you need to install Apache HTTPD in Red Hat Enterprise Linux 6, use the instructions from the Red Hat Enterprise Linux 6 Deployment Guide, available from https://access.redhat.com/knowledge/docs/.
- If you need to install the stand-alone HTTPD included as a separate downloadable component of JBoss Enterprise Application Platform 6, refer to Section 13.2.9, “Install the Apache HTTPD included with JBoss Enterprise Application Platform 6”.
- If you need to install JBoss Enterprise Web Server, use the instructions from the JBoss Enterprise Web Server Installation Guide, available from https://access.redhat.com/knowledge/docs/.
- Download the Webserver Connecter Natives package for your operating system and architecture from the Red Hat Customer Portal at https://access.redhat.com. This package contains the mod_cluster binary HTTPD modules precompiled for your operating system. After you extract the archive, the modules are located in the
etc/contains some example configuration files, and the
share/directory contains some supplemental documentation.
- You must be logged in with administrative (root) privileges.
Procedure 13.7. Task
Determine your HTTPD configuration location.Your HTTPD configuration location will be different depending on whether you are using Red Hat Enterprise Linux's Apache HTTPD, the stand-alone HTTPD included as a separate downloadable component with JBoss Enterprise Application Platform 6, or the HTTPD available in JBoss Enterprise Web Server. It is one of the following three options, and is referred to in the rest of this task as HTTPD_HOME.
- Apache HTTPD -
- JBoss Enterprise Application Platform HTTPD - This location is chosen by you, based on the requirements of your infrastructure.
- JBoss Enterprise Web Server HTTPD -
Copy the modules to the HTTPD modules directory.Copy the four modules (the files ending in
.so) from the
modules/native/lib/httpd/modules/directory of the extracted Webserver Natives archive to the
For Enterprise Web Server, disable the
mod_proxy_balancermodule.If you use JBoss Enterprise Web Server, the
mod_proxy_balancermodule is enabled by default. It is incompatible with mod_cluster. To disable it, edit the
HTTPD_HOME/conf/httpd.confand comment out the following line by placing a
#(hash) symbol before the line which loads the module. The line is shown without the comment and then with it, below.
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
# LoadModule proxy_balancer_module modules/mod_proxy_balancer.soSave and close the file.
Configure the mod_cluster module.
HTTPD_HOME/conf/httpd.confin a text editor and add the following to the end of the file:
# Include mod_cluster's specific configuration file Include conf/JBoss_HTTP.confSave and exit the file.
- Create a new file called
HTTPD_HOME/httpd/conf/JBoss_HTTP.confand add the following to it.
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.soThis causes Apache HTTPD to automatically load the modules that
mod_clusterneeds in order to function.
Create a proxy server listener.Continue editing
HTTPD_HOME/httpd/conf/JBoss_HTTP.confand add the following minimal configuration, replacing the values in capital letters with sensible ones for your system.
Listen IP_ADDRESS:PORT <VirtualHost IP_ADDRESS:PORT> <Location /> Order deny,allow Deny from all Allow from *.MYDOMAIN.COM </Location> KeepAliveTimeout 60 MaxKeepAliveRequests 0 EnableMCPMReceive On ManagerBalancerName mycluster ServerAdvertise On </VirtualHost>These directives create a new virtual server which listens on
IP_ADDRESS:PORT, allows connections from
MYDOMAIN.COM, and advertises itself as a balancer called
mycluster. These directives are covered in detail in the documentation for Apache Web Server. To learn more about the
EnableMCPMReceivedirectives, and the implications of server advertisement, refer to Section 13.3.4, “Configure Server Advertisement Properties for Your mod_cluster-enabled HTTPD”.Save the file and exit.
Restart the HTTPD.The way to restart the HTTPD depends on whether you are using Red Hat Enterprise Linux's Apache HTTPD or the HTTPD included in JBoss Enterprise Web Server. Choose one of the two methods below.
Red Hat Enterprise Linux 6 Apache HTTPDIssue the following command:
service httpd restart
JBoss Enterprise Web Server HTTPDJBoss Enterprise Web Server runs on both Red Hat Enterprise Linux and Microsoft Windows Server. The method for restarting the HTTPD is different for each.
Red Hat Enterprise LinuxIn Red Hat Enterprise Linux, Enterprise Web Server installs its HTTPD as a service. To restart the HTTPD, issue the following two commands:
[root@host ~]# service httpd stop
[4oot@host ~]# service httpd start
Microsoft Windows ServerIssue the following commands in a command prompt with administrative privileges:
C:\> net stop httpd
C:\> net start httpd
The Apache HTTPD is now configured as a load balancer, and can work with the
mod_cluster subsystem running JBoss Enterprise Application Platform 6. To configure the JBoss Enterprise Application Platform to be aware of mod_cluster, refer to Section 13.3.5, “Configure a mod_cluster Worker Node”.