16.5.3. Install the mod_cluster Module Into Apache HTTPD or JBoss Enterprise Web Server HTTPD
Prerequisites
- 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 EAP 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/site/documentation/.
- If you need to install the stand-alone HTTPD included as a separate downloadable component of JBoss EAP 6, refer to Section 16.3.2, “Install the Apache HTTPD included with JBoss EAP 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/site/documentation/.
- 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
modules/native/lib/httpd/modules/
directory.Theetc/
directory contains some example configuration files, and theshare/
directory contains some supplemental documentation. - You must be logged in with administrative (root) privileges.
Procedure 16.5. Install the mod_cluster Module
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 EAP 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 -
/etc/httpd/
- JBoss EAP 6 HTTPD - This location is chosen by you, based on the requirements of your infrastructure.
- JBoss Enterprise Web Server HTTPD -
EWS_HOME/httpd/
Copy the modules to the HTTPD modules directory.
Copy the four modules (the files ending in.so
) from themodules/native/lib/httpd/modules/
directory of the extracted Webserver Natives archive to theHTTPD_HOME/modules/
directory.For JBoss Enterprise Web Server, disable the
mod_proxy_balancer
module.If you use JBoss Enterprise Web Server, themod_proxy_balancer
module is enabled by default. It is incompatible with mod_cluster. To disable it, edit theHTTPD_HOME/conf/httpd.conf
and 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.so
Save and close the file.Configure the mod_cluster module.
The Webserver Natives archive contains a samplemod_cluster.conf
file (modules/system/layers/base/native/etc/httpd/conf
). This file can be used as a guide or copied and edited to create aHTTPD_HOME/httpd/conf.d/JBoss_HTTP.conf
file.Note
Using the nameJBoss_HTTP.conf
is an arbitrary convention in this document. The configuration file will be loaded, regardless of its name, if it is saved in theconf.d/
directory with the.conf
extension.Add the following to your configuration file: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.so
This causes Apache HTTPD to automatically load the modules thatmod_cluster
needs in order to function.Create a proxy server listener.
Continue editingHTTPD_HOME/httpd/conf.d/JBoss_HTTP.conf
and 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 onIP_ADDRESS:PORT
, allows connections fromMYDOMAIN.COM
, and advertises itself as a balancer calledmycluster
. These directives are covered in detail in the documentation for Apache Web Server. To learn more about theServerAdvertise
andEnableMCPMReceive
directives, and the implications of server advertisement, refer to Section 16.5.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 HTTPD
Issue the following command:[root@host]#
service httpd restart
JBoss Enterprise Web Server HTTPD
JBoss 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 Linux
In Red Hat Enterprise Linux, JBoss Enterprise Web Server installs its HTTPD as a service. To restart the HTTPD, issue the following two commands:[root@host ~]# service httpd stop
[root@host ~]# service httpd start
Microsoft Windows Server
Issue the following commands in a command prompt with administrative privileges:C:\> net stop httpd
C:\> net start httpd
Result
The Apache HTTPD is now configured as a load balancer, and can work with the mod_cluster
subsystem running JBoss EAP 6. To configure JBoss EAP 6 to be aware of mod_cluster, refer to Section 16.5.5, “Configure a mod_cluster Worker Node”.