3 Replies Latest reply on Jan 9, 2015 4:32 AM by jfclere

    mod_cluster with multiple VirtualHosts redirected to the same cluster but having different DocumentRoots

    serpikv

      Hello,

       

      I would appreciate help with the following scenario.

       

      We are trying to build the following configuration:

       

         - we have multiple DNS names, say test1.aaa.com, test2.aaa.com

        

         - we want all of them to be redirected to the same jBoss cluster

           (if url contains context-root xxx like test1.aaa.com/xxx/... or test2.aaa.com/xxx/...)

          

         - at the same time we want each DNS to have it's own DocumentRoot

           (so that NOT redirected URLs like test1.aaa.com/index.html and test2.aaa.com/index.html lead to the different pages)

        

         - we have 2 Apache HTTPD servers (balanced with F5)

        

         - on the jBoss server side we have:

        

           <mod-cluster-config advertise-socket="mycluster" proxy-list="10.0.5.51:80,10.0.5.71:80" advertise="false" connector="ajp">

          

         - on HTTPD side we have (similar configuration for the second server):

        

         Listen 10.0.5.51:80

       

         <VirtualHost 10.0.5.51:80>

             DocumentRoot /var/www/html/test1

             ServerName test1.aaa.com

        

             <Location /xxx>

                 Order deny,allow

                 Allow from all

             </Location>

        

             <Location /mod_cluster-manager>

                 SetHandler mod_cluster-manager

                 Order deny,allow

                 Allow from all

             </Location>

        

             KeepAliveTimeout 60

             MaxKeepAliveRequests 0

       

             EnableMCPMReceive On

        

         </VirtualHost>

        

         <VirtualHost 10.0.5.51:80>

             DocumentRoot /var/www/html/test2

             ServerName test2.aaa.com

       

             <Location /xxx>

                Order deny,allow

                Allow from all

             </Location>

        

             <Location /mod_cluster-manager>

                SetHandler mod_cluster-manager

                Order deny,allow

                Allow from all

             </Location>

        

             KeepAliveTimeout 60

             MaxKeepAliveRequests 0

           

             EnableMCPMReceive On 

            

         </VirtualHost>

       

       

         - our setting works but is it the right way to achieve what we want?

         - "EnableMCPMReceive On" in both VirtualHost configurations looks excessive as cluster manager for both hosts listens on the same IP/port