2 Replies Latest reply on Mar 4, 2014 6:39 AM by Nelson Wilson

    Jboss EAP-6.1.0.Alpha - Clustering - Apache mod_jk - load balancing - 302 redirect issue.

    Prahari R Newbie

      Hi all,


      I am trying to create a clustered jboss environment with apache fronting for load balancing.

      The versions i am using are: Jboss: EAP-6.1.0.Alpha, Apache httd: 2.2.25, mod_jk: tomcat-connectors-1.2.37.


      For clustering jboss, I have started with two VM virtual boxes, installed jboss on both and have configured one as domain-controller and the other as slave.


      For the domain controller, in domain.xml, i have defined a server group with ha profile and ha-sockets.


              <server-group name="cluster-ha" profile="ha">

                  <jvm name="default"/>

                  <socket-binding-group ref="ha-sockets"/>



      In host.xml, i have added one server:


              <server name="node-one" group="cluster-ha" auto-start="true">



      The domain controller is stated using: domain.sh -Djboss.bind.address= -Djboss.bind.address.management=


      For the slave, in host-slave.xml, i have added the secret from the user created on domain-controller and created one server:


              <server name="node-two" group="cluster-ha" auto-start="true">



      The slave is stated using: domain.sh --host-config=host-slave.xml -Djboss.domain.master.address= -Djboss.bind.address= -Djboss.bind.address.management=


      I am able to successfully start both the servers and in the logs i am able to see that the servers are clustered. I am able to deploy applications to the server group and am able to access application on each server individually.


      Now to achieve load balancing, on a new server, i have installed Apache 2.2.25, mod_jk (tomcat-connectors-1.2.37).

      In httpd.conf, i have enabled ssl_module, and added 1) Include conf/extra/httpd-ssl.conf for SSL conf, 2) Include conf/mod-jk.conf

      In mod-jk.cof, have done JkWorkersFile conf/workers.properties to indicate the workers.

      The workers.properties is defined as:


      # for mapping requests



      # Set properties for Node1 (ajp13)

      # modify the host as your host IP or DNS name.









      # Set properties for Node2 (ajp13)

      # modify the host as your host IP or DNS name.









      # Load-balancing behaviour





      # Add the status worker to the worker list


      # Define a 'jkstatus' worker using status



      In httpd-ssl.conf, i have added

      JkMount /myapp/* loadbalancer1

      JkMount /myapp loadbalancer1


      Now when i access the application, the login page is presented and when i submit information, i am redirected back to login page. When i inspect the browser traffic, i see https://webserver1/myapp/login/submit redirect 302 temporarily moved. When i check apache ssl_request logs i see: TLSv1 DHE-RSA-AES256-SHA "POST /myapp/login/submit HTTP/1.1" -

      In the access.log i see:

      "POST /myapp/login/submit HTTP/1.1" 302 -


      When i remove the balancing by removing either node1 or node2 from worker.loadbalancer1.balance_workers=node1,node2, the application run normally.


      Please provide any pointers to help me understand where my configuration is wrong.


      Thank you in advance and sorry for the really long post.