13 Replies Latest reply on Apr 3, 2013 5:41 AM by jfclere

    mod_cluster with multiple virtual hosts and multiple server groups

    victor213

      I'm running mulitple virtual hosts on a web server.  Behind them is a jboss domain with multiple server groups, say exampleCluster1 and exampleCluster2.  Each server group has a different deployment. 

       

      This works with a single server group, exampleCluster1, but how do I configure this so that traffic to a virtual host knows which server group to go to? 

       

      mod_cluster.conf:

       

      Listen 192.168.10.1:6666

      CreateBalancers 1

        <VirtualHost 192.168.10.1:6666>

          <Directory />

          Order deny,allow

          Deny from all

          Allow from 192.168.10.

        </Directory>

        <Location /mod_cluster-manager>

          SetHandler mod_cluster-manager

          Order deny,allow

          Allow from 192.168.10.

        </Location>

        KeepAliveTimeout 300

        MaxKeepAliveRequests 0

        ServerAdvertise On

        EnableMCPMReceive

      </VirtualHost>

       

      example site conf:

       

      <VirtualHost 192.168.10.1:7777>

              ServerAdmin my@email.address

              ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On

              ProxyPassReverse / balancer://mycluster

              ProxyPreserveHost On

              DocumentRoot /my/doc/root

              ServerName my.server.name

              <Directory /my/doc/root>

                      Options -FollowSymLinks -Includes -Indexes -MultiViews

                      AllowOverride None

                      Order allow,deny

                      allow from all

              </Directory>

              ErrorLog ${APACHE_LOG_DIR}/example-error.log

              # Possible values include: debug, info, notice, warn, error, crit,

              # alert, emerg.

              LogLevel warn

             CustomLog ${APACHE_LOG_DIR}/example-access.log combined

      </VirtualHost>

       

      And I have the following full-ha profile updates:

       

      <subsystem xmlns="urn:jboss:domain:modcluster:1.0">

        <mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.10.1:6666">

        <dynamic-load-provider>

            <load-metric type="busyness"/>

         </dynamic-load-provider>

        </mod-cluster-config>

      </subsystem>

       

      AND...

       

      <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="${jboss.node.name}" native="false">

         <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

         <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>

         <virtual-server name="default-host" enable-welcome-root="false">

            <alias name="localhost"/>

             <alias name="example.com"/>

         </virtual-server>

      </subsystem>