1

I am working on setting up an apache load balancer with 2 members. These three servers are windows server 2012 using apache 2.4.9. I am working to make one load balancing cluster serve up multiple sites. For right now two are setup localhost and test1 when I go to localhost all is well the load balancer is working... When I go to test1 the sub servers are loading the localhost config (which is the default) I am thinking this is something like the test1 url is not being passed to the workers so the workers can't identify it.

Here is what the virtual host config looks like for localhost on the load balancer [note it's made generic for client's sake]....

  <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "E:/generic-page/www"
    ServerName localhost
    ErrorLog "E:/_logs/localhost-error.log"
    CustomLog "E:/_logs/localhost-access.log" common


     ProxyRequests Off  
        <Proxy *>
          AllowOverride All
          Require all granted
        </Proxy>    
        ProxyPass /balancer-manager !
        ProxyPass / balancer://mycluster/ stickysession=PHPSESSIONID nofailover=On

        <Location /balancer-manager>
           SetHandler balancer-manager
           Require all granted
            </Location>


        #ProxyPassReverse / http://tstweb1.somewhere.org:80
        #ProxyPassReverse / http://tstweb2.somewhere.org:80
        <Proxy balancer://mycluster>
          BalancerMember http://tstweb1.somewhere.org:80 loadfactor=1
          BalancerMember http://tstweb2.somewhere.org:80 loadfactor=2
          ProxySet lbmethod=byrequests
        </Proxy>
    <Location />
           ProxyPass balancer://mycluster/ stickysession=PHPSESSIONID
        </Location>
</VirtualHost>

Here is what the test1 looks like on the load balancer...

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "E:/test1/trunk"
    ServerName test1
    ErrorLog "E:/test1/_logs/test1-error.log"
    CustomLog "E:/test1/_logs/test1-access.log" common

    ProxyRequests Off   
    <Proxy *>
      AllowOverride All
      Require all granted
    </Proxy>    
    ProxyPass /balancer-manager !
    ProxyPass / balancer://test1cluster/ stickysession=PHPSESSIONID nofailover=On

    <Location /balancer-manager>
       SetHandler balancer-manager
       Require all granted
        </Location>
    <Location />
       ProxyPass balancer://test1cluster/ stickysession=PHPSESSIONID
    </Location>

    #ProxyPassReverse / http://tstweb1.somewhere.org:80
    #ProxyPassReverse / http://tstweb2.somewhere.org:80
    <Proxy balancer://test1cluster>
      BalancerMember http://tstweb1.somewhere.org:80 loadfactor=1
      BalancerMember http://tstweb2.somewhere.org:80 loadfactor=2
      ProxySet lbmethod=byrequests
    </Proxy>
</VirtualHost>

On each of the worker machines I have a standard virtual host setup. no proxy pass, just standard configs that the machine would work fine if the domain is point to it.

This is my first time trying to set all this up so I welcome any feedback that can help me get multiple domains and sites to work on a single cluster.

Anyone have any ideas how to fix this issue?

1
  • Shouldn't the <Proxy balancer://test1cluster> be the same on both servers? I haven't had a look at this much yet, but seems to me the name should be the same on all members
    – Joey
    Jul 14, 2014 at 9:45

0

You must log in to answer this question.