Red Hat Training

A Red Hat training course is available for Red Hat JBoss Web Server

Chapter 6. Working Examples

6.1. Complete Working Example

Following are a set of example configuration files for a complete working example.
Load Balancer

A proxy server listening on localhost:

LoadModule proxy_cluster_module modules/
LoadModule cluster_slotmem_module modules/
LoadModule manager_module modules/
LoadModule advertise_module modules/

MemManagerFile cache/mod_cluster

<IfModule manager_module>
  Listen 6666
  <VirtualHost *:6666>
    <Directory />
      Require ip
    ServerAdvertise on
    <Location /mod_cluster_manager>
      SetHandler mod_cluster-manager
      Require ip
Worker Configuration for Tomcat

Edit JWS_HOME/tomcat<VERSION>/conf/server.xml, and add the following listener element to configure the worker for Tomcat:

<Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener" advertise="true"/>
Example iptables Firewall Rules

Following are a set of example firewall rules using iptables, for a cluster node on the subnet.

/sbin/iptables -I INPUT 5 -p udp -d -j ACCEPT -m comment --comment "mod_cluster traffic"
/sbin/iptables -I INPUT 6 -p udp -d -j ACCEPT -m comment --comment "JBoss Cluster traffic"
/sbin/iptables -I INPUT 9 -p udp -s -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
/sbin/iptables -I INPUT 10 -p tcp -s -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
/etc/init.d/iptables save