Apache2 load balance url fail

Discussion in 'Server Operation' started by RPGglitchy, Apr 19, 2013.

  1. RPGglitchy

    RPGglitchy New Member

    Hi,

    I managed to get my apache2 load balancer working but there is a problem with my url. I got the following on my first webserver's vhost.

    ServerName http1.site1.stage.be
    DocumentRoot /var/www/site1.be
    RewriteEngine On
    RewriteRule .* - [CO=BALANCEID:balancer.http1:.site1.stage.be]

    The same for my second webserver but http2 instead in the rewriterule.

    Now.. In my loadbalancer I have the following in apache2.conf:

    <Proxy balancer://stage>
    BalancerMember http://172.16.100.190 route=http1
    BalancerMember http://172.16.100.191 route=http2
    ProxySet lbmethod=byrequests
    </Proxy>
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    <VirtualHost *:80>
    ServerName site1.stage.be
    ProxyRequests Off
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^site1.stage\.be$ [NC]
    RewriteRule ^(.*)$ http://site1.stage.be/$1 [L,R=301]
    ProxyPass / balancer://stage/site1.be stickysession=BALANCEID nofailover=On
    ProxyPassReverse / http://172.16.100.190/site1.be
    ProxyPassReverse / http://172.16.100.191/site1.be
    </VirtualHost>


    Now when I visit 'site1.stage.be' it does direct me to the servers website but the URL is '172.16.100.190/site1.be' instead.
    What am I doing wrong here? Hope you can help me!

    Sorry for the long post, I don't even have a potato to offer!
    Thx in advance!
    Glitchy
     

Share This Page