JBoss.orgCommunity Documentation

Chapter 2. Quick Start Guide

2.1. Download mod_cluster components
2.2. Install the httpd binary
2.2.1. Install the whole httpd
2.2.2. Install only the modules
2.2.3. Install in home directory
2.2.4. Install in Windows
2.3. Configure httpd
2.4. Install the server-side binaries
2.4.1. Installing in JBoss AS 6.x
2.4.2. Installing in JBoss AS 5.x
2.4.3. Installing in Tomcat
2.4.4. Installing in JBoss AS 4.2.x or 4.3.x
2.5. Configuring the server-side
2.5.1. Configuring mod_cluster with JBoss AS 5.x+
2.5.2. Configuring mod_cluster with standalone JBoss Web or Tomcat
2.5.3. Integrate mod_cluster with JBoss AS 4.2.x and 4.3.x
2.6. Start httpd
2.7. Start the back-end server
2.7.1. Starting JBoss AS
2.7.2. Starting JBossWeb or Tomcat
2.8. Set up more back-end servers
2.9. Experiment with the Load Balancing Demo Application

The following are the steps to set up a minimal working installation of mod_cluster on a single httpd server and a single back end server, either JBoss AS, JBossWeb or Tomcat. The steps can be repeated to add as many httpd servers or back end servers to your cluster as is desired.

The steps shown here are not intended to demonstrate how to set up a production install of mod_cluster; for example using SSL to secure access to the httpd-side mod_manager component is not covered. See the httpd-side and java-side configuration documentation for the full set of configuration options.

Download the latest httpd and java release bundles. If there is no pre-built httpd bundle appropriate for your OS or system architecture, you can build the binary from source.

Since 1.1.0.CR2 httpd.conf is preconfigured with the Quick Start values. You should adapt the default values to your configuration with older mod_cluster we will have to add the following to httpd.conf. If you extracted the download bundle to root as shown above and are using that extract as your httpd install, httpd.conf is located in /opt/jboss/httpd/httpd/conf.

LoadModule proxy_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy.so
LoadModule proxy_ajp_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy_ajp.so
LoadModule slotmem_module /opt/jboss/httpd/lib/httpd/modules/mod_slotmem.so
LoadModule manager_module /opt/jboss/httpd/lib/httpd/modules/mod_manager.so
LoadModule proxy_cluster_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy_cluster.so
LoadModule advertise_module /opt/jboss/httpd/lib/httpd/modules/mod_advertise.so
 
Listen 10.33.144.3:6666
<VirtualHost 10.33.144.3:6666>
 
  <Directory />
    Order deny,allow
    Deny from all
    Allow from 10.33.144.
  </Directory>
 
  KeepAliveTimeout 60
  MaxKeepAliveRequests 0
 
  ManagerBalancerName mycluster
  AdvertiseFrequency 5
 
</VirtualHost>

If you are using your own install of httpd, httpd.conf is found in your install's conf directory. The content to add to httpd.conf is slightly different from the above (different path to the various .so files):

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
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
 
Listen 10.33.144.3:6666
<VirtualHost 10.33.144.3:6666>
 
  <Directory />
    Order deny,allow
    Deny from all
    Allow from 10.33.144.
  </Directory>
 
  KeepAliveTimeout 60
  MaxKeepAliveRequests 0
 
  ManagerBalancerName mycluster
  AdvertiseFrequency 5
 
</VirtualHost>

First, extract the java-side binary to a temporary directory. The following assumes it was extracted to /tmp/mod-cluster

Your next step depends on whether your target server is JBoss AS or JBoss Web/Tomcat.

To start httpd do the following:

/opt/jboss/httpd/sbin/apachectl start

Repeat the back-end server install and configuration steps for each server in your cluster.

The load balancing demo application is a good way to learn about mod_cluster's capabilities.