After setting up JBoss clusters as explained in Setting up JBoss 5 AS cluster nodes, we can setup the web load balancing.
Install Apache 2. You can get it from http://httpd.apache.org.
Install mod_jk to the apache. You can get it from http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/
Let us say that you have added node1 in mod_jk installation. To the first node of your JBoss 5 cluster edit the file deployers/jbossweb.deployer/server.xml add attribute jvmRoute=”node1″ to the element <Engine>, so the element will look like this: <Engine name=”jboss.web” defaultHost=”localhost” jvmRoute=”node1″>.
Edit deployers/jbossweb.deployer/META-INF/war-deployers-beans.xml, to the bean WebAppClusteringDefaultsDeployer add property: <property name=”useJK”>true</property>
Do the same to other nodes.
Edit your web applications web.xml. Add <distributable/>
Edit your web applications jboss-web.xml