19.5.3. Install the mod_cluster Module Into Apache HTTP Server or JBoss Enterprise Web Server (Zip)
Prerequisites
- To perform this task, you must be using Apache HTTP Server installed in Red Hat Enterprise Linux 6, or JBoss Enterprise Web Server, or the standalone Apache HTTP Server included as a separate downloadable component of JBoss EAP 6.
- If you need to install Apache HTTP Server in Red Hat Enterprise Linux 6, use the instructions from the Red Hat Enterprise Linux 6 Deployment Guide.
- If you need to install the standalone Apache HTTP Server included as a separate downloadable component of JBoss EAP 6, refer to Section 19.3.2, “Install the Apache HTTP Server included with JBoss EAP 6 (Zip)”.
- If you need to install JBoss Enterprise Web Server, use the instructions from the JBoss Enterprise Web Server Installation Guide.
- 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 web server modules precompiled for your operating system. After you extract the archive, the modules are located in the
EAP_HOME/modules/system/layers/base/native/lib/httpd/modulesdirectory.Theetc/directory contains some example configuration files, and theshare/directory contains some supplemental documentation. - You must be logged in with administrative (root) privileges.
Note
EAP_HOME/modules/system/layers/base/native/lib64/httpd/modules. You must use this path whenever you need access to the modules.
Procedure 19.7. Install the mod_cluster Module
Determine your Apache HTTP Server configuration location.
Your Apache HTTP Server configuration location will be different depending on whether you are using Red Hat Enterprise Linux's Apache HTTP Server, the standalone Apache HTTP Server included as a separate downloadable component with JBoss EAP 6, or the Apache HTTP Server 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 HTTP Server -
/etc/httpd/ - JBoss EAP 6 Apache HTTP Server - This location is chosen by you, based on the requirements of your infrastructure.
- JBoss Enterprise Web Server Apache HTTP Server -
EWS_HOME/httpd/
Copy the modules to the Apache HTTP Server modules directory.
Copy the four modules (the files ending in.so) from theEAP_HOME/modules/system/layers/base/native/lib/httpd/modulesdirectory of the extracted Webserver Natives archive to theHTTPD_HOME/modules/directory.For JBoss Enterprise Web Server, disable the
mod_proxy_balancermodule.If you use JBoss Enterprise Web Server, themod_proxy_balancermodule is enabled by default. It is incompatible with mod_cluster. To disable it, edit theHTTPD_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.so
Save and close the file.Configure the mod_cluster module.
The Webserver Natives archive contains a samplemod_cluster.conffile (EAP_HOME/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.conffile.Note
Using the nameJBoss_HTTP.confis 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.confextension.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 HTTP Server to automatically load the modules thatmod_clusterneeds in order to function.Create a proxy server listener.
Continue editingHTTPD_HOME/httpd/conf.d/JBoss_HTTP.confand add the following minimal configuration, replacing the values in capital letters with suitable values for your environment.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 theServerAdvertiseandEnableMCPMReceivedirectives, and the implications of server advertisement, see Section 19.5.5, “Configure Server Advertisement Properties for Your mod_cluster-enabled Web Server”.Save the file and exit.Restart the Apache HTTP Server.
The way to restart the Apache HTTP Server depends on whether you are using Red Hat Enterprise Linux's Apache HTTP Server or the Apache HTTP Server included in JBoss Enterprise Web Server. Choose one of the two methods below.Red Hat Enterprise Linux 6 Apache HTTP Server
Issue the following command:[root@host]#
service httpd restartJBoss Enterprise Web Server HTTP Server
JBoss Enterprise Web Server runs on both Red Hat Enterprise Linux and Microsoft Windows Server. The method for restarting the Apache HTTP Server is different for each.Red Hat Enterprise Linux
In Red Hat Enterprise Linux, JBoss Enterprise Web Server installs its Apache HTTP Server as a service. To restart the Apache HTTP Server, issue the following two commands:[root@host ~]# service httpd stop[root@host ~]# service httpd startMicrosoft Windows Server
Issue the following commands in a command prompt with administrative privileges:C:\> net stop httpdC:\> net start httpd
The Apache HTTP Server 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, see Section 19.5.6, “Configure a mod_cluster Worker Node”.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.