title: JBoss and Apache Load Balancing
body: <p>I am trying to set up a JBoss Cluster with Apache Load Balancing. Basically I have followed the guide from <a href="http://community.jboss.org/wiki/UsingModjk12WithJBoss;jsessionid=1569CBFB7C3096C59C977CD3F7159A32#comment-4181" rel="nofollow noreferrer">here</a>. No problem faced. The only issue I have would be, how do I access my own application? From the guide, it didnt mention how do I mount my own application. </p>
  
  <p>Here's my environment setup:</p>
  
  <ul>
  <li>Windows XP</li>
  <li>JBoss AS 5.0</li>
  <li>Apache 2.2.16</li>
  <li>mod_jk 1.2.30</li>
  </ul>
  
  <p>Here's my properties setting:</p>
  
  <p><strong>httpf.conf</strong></p>
  
  <pre><code>Include conf/mod_jk.conf
  </code></pre>
  
  <p><strong>mod_jk.conf</strong></p>
  
  <pre><code>LoadModule jk_module modules/mod_jk.so   
  JkWorkersFile conf/workers.properties   
  JkLogFile logs/mod_jk.log   
  JkLogLevel info   
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"   
  JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories   
  JkRequestLogFormat "%w %V %T"   
  JkMount /application/* loadbalancer   
  JkUnMount /application/images/* loadbalancer   
  JkMountFile conf/uriworkermap.properties   
  JkShmFile run/jk.shm
  
  &lt;Location /jkstatus&gt;
  JkMount status
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1
  &lt;/Location&gt;
  </code></pre>
  
  <p><strong>workers.properties</strong></p>
  
  <pre><code>worker.list=loadbalancer,status
  worker.node1.port=8009
  worker.node1.host=10.67.51.129
  worker.node1.type=ajp13
  worker.node1.lbfactor=1
  worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
  worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
  worker.node1.ping_mode=A #As of mod_jk 1.2.27
  
  worker.node2.port=8009
  worker.node2.host= 10.67.51.64
  worker.node2.type=ajp13
  worker.node2.lbfactor=1
  worker.node2.prepost_timeout=10000 #Not required if using ping_mode=A
  worker.node2.connect_timeout=10000 #Not required if using ping_mode=A
  worker.node2.ping_mode=A #As of mod_jk 1.2.27
  
  worker.loadbalancer.type=lb
  worker.loadbalancer.balance_workers=node1,node2
  
  worker.status.type=status
  </code></pre>
  
  <p><strong>uriworkermap.properties</strong></p>
  
  <pre><code>/jmx-console=loadbalancer
  /jmx-console/*=loadbalancer
  
  /web-console=loadbalancer
  /web-console/*=loadbalancer
  
  /admin-console=loadbalancer
  /admin-console/*=loadbalancer
  
  /myapp/*=loadbalancer
  !/myapp/images/*=loadbalancer
  </code></pre>
  
  <p><strong>server.xml</strong> in JBoss</p>
  
  <pre><code>&lt;Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1"&gt;
  &lt;!-- A AJP 1.3 Connector on port 8009 --&gt;
  &lt;Connector port="8009" address="${jboss.bind.address}"
    emptySessionPath="true" enableLookups="false" redirectPort="8443" 
    protocol="AJP/1.3" connectionTimeout="600000" maxThreads="200"/&gt;
  </code></pre>
  
  <p>This is how I start the JBoss</p>
  
  <p><em>Comp1</em></p>
  
  <pre><code>run.bat -c all -g DefaultPartition -u 230.0.0.4 -b 10.67.51.129 -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-default
  </code></pre>
  
  <p><em>Comp2</em></p>
  
  <pre><code>run.bat -c all -g DefaultPartition -u 230.0.0.4 -b 10.67.51.64 -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-01
  </code></pre>
  
  <p>My application name is called JBossDB. When i tired to access 10.67.51.129:8080/JBossDB
  I am able to launch my application. But if I tried to launch localhost/JBossDB it doesnt load. Note, I am able to launch localhost/admin-console. </p>
  
  <p>I hope I have provided all the necessary info. Please help me out. Thanks</p>