JBoss.orgCommunity Documentation

Chapter 2. Quick Start Guide

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 JBossWeb/Tomcat.

mod_cluster is integrated into your web server by adding an implementation of the Tomcat LifecycleListener interface to the server's configuration, and by giving each node a unique name.

To start httpd do the following:

    /opt/jboss/httpd/sbin/apachectl start 

Repeat the back end server install and configuration steps; just be sure to use a different jvmRoute for each server.

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