3 Replies Latest reply on Jun 30, 2011 3:40 AM by mbabacek

    Apache / Tomcat6 + mod_cluster configuration

    willemnoorduin

      For some clients we need to connect Apache2 to Tomcat and I want to try this with mod_cluster. After googling a lot it was clear that you need Tomcat > 6 (Tomcat5 is not accepting the Listener). When I start Tomcat, I get the following in the catalina.out:

       

      INFO: Deploying web application directory docs

      Jun 24, 2011 8:20:02 AM org.apache.catalina.startup.HostConfig deployDirectory

      INFO: Deploying web application directory ROOT

      Jun 24, 2011 8:20:02 AM org.apache.coyote.http11.Http11Protocol start

      INFO: Starting Coyote HTTP/1.1 on http-8080

      Jun 24, 2011 8:20:02 AM org.apache.jk.common.ChannelSocket init

      INFO: JK: ajp13 listening on /0.0.0.0:8009

      Jun 24, 2011 8:20:02 AM org.apache.jk.server.JkMain start

      INFO: Jk running ID=0 time=0/16  config=null

      Jun 24, 2011 8:20:02 AM org.apache.catalina.startup.Catalina start

      INFO: Server startup in 1518 ms

      Jun 24, 2011 8:20:12 AM org.jboss.modcluster.ModClusterService

      INFO: Engine connector will use address: 145.78.121.33

      Jun 24, 2011 8:20:12 AM org.jboss.modcluster.ModClusterService

      INFO: Engine will use jvmRoute: 2b9ec669-7811-3129-b20a-5799767d5c78

       

      So it is creating a jvmRoute for me, which is default mod_cluster > 1.1 behaviour when you don't set a jvmRoute in Tomcat's server.xml. As to the Apache configuration, I am drawing a blank. You cannot use the cluster commands, so something like:

       

       

       

      will not work. There is no hint in the mod_cluster documentation either what to use instead. Can someone tell me what commands I must use to connect my Apache Virtual Host via mod_cluster to Tomcat 6.

        • 1. Re: Apache / Tomcat6 + mod_cluster configuration
          mbabacek

          Hi,

          You cannot use the cluster commands, so something like:
          blank line
          will not work.

          What do you mean by that statement? Do you have an empty Httpd configuration?

          Can someone tell me what commands I must use to connect my Apache Virtual Host via mod_cluster to Tomcat 6.

          Do you mean httpd config by "commands" in the aforementioned statement?

           

          THX for clarification.

          • 2. Re: Apache / Tomcat6 + mod_cluster configuration
            willemnoorduin

            Seems like my Virtual host tags are not represented correctly. Sorry for that. Well, this is my Virtual Host:

             

            < VirtualHost

             

            * >
                ServerAdmin unix@tntpost.nl
                DocumentRoot /apps/www.test.nl/data
                ServerName www.test.nl
                ErrorLog logs/www.test.nl-error_log
                CustomLog logs/www.test.nl-access_log combined
                LogLevel debug

                ProxyPass / balancer://cluster1/application1 stickysession=JSESSIONID|jsessionid nofailover=On
                ProxyPassReverse / balancer://cluster1/application1
            < /VirtualHos t>

            You cannot use the

             

            ProxyPass / balancer://cluster1/application1 stuff because you do not have a cluster like in JBoss-AS and you cannot set a cluster varaible for Tomcat (to represent cluster1, for example). Questions are:

             

            • What can you use instead for passing jsp and so on to Tomcat (with mod_jk, the answer was JkMount) ?
            • What do you use when you want to connect two or more Tomcats (with mod_jk the answer was workers.properties) ?
            • 3. Re: Apache / Tomcat6 + mod_cluster configuration
              mbabacek

              Well, I would use for a httpd machine called superbox01 e.g.:

               

              Listen 8886
              <VirtualHost superbox01:8886>
                   ServerName superbox01
                   ManagerBalancerName supercluster
                   ServerAdvertise On
                  AdvertiseGroup 224.0.1.105:23364
              </VirtualHost>
              

               

              And on Tomcat6 side in server.xml:

               

              <Listener className="org.jboss.modcluster.ModClusterListener" stickySession="true" stickySessionRemove="true" stickySessionForce="false" />
              

               

              This configuration applies for Mod_Cluster 1.0.x (see docs)

              Mod_Cluster 1.1x introduces some additional features (see docs).

               

              Note: The aforementioned configuration needs multicast enabled between the httpd and Tomcat6 box. In case you can't enable multicast, use proxyList.