Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th March 2009, 22:45
Franck Franck is offline
Junior Member
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Default Apache Loadbalancer with multiple VHosts

Good evening,

First thanks for the great tutorial by Falko "Creating A Session-Aware Loadbalancer Using mod_proxy_balancer".

I have used it and it is running fine coupled with Sharedance for session management.

I have 2 questions:

1. In the balancer manager interface one can set up route Redirects in case of failover. However if the Apache load balancer restarts, the settings are lost. Is there any way of making them persistent?


2. On the 2 front end servers I have several vhost. Like this:

Server 1:
<VirtualHost *:80>
ServerName 172.18.2.40
...
</VirtualHost>
<VirtualHost *:80>
ServerName www1.example.com
...
</VirtualHost>

Server2:
<VirtualHost *:80>
ServerName 172.18.2.41
...
</VirtualHost>

<VirtualHost *:80>
ServerName www2.example.com
...
</VirtualHost>

I have balanced the 2 vhost associated with the server's local IPs addresses:
BalancerMember http://172.18.2.40:80 route=http1
BalancerMember http://172.18.2.41:80 route=http2
And it works fine. However I now would like to balance (btw still on port 80) www1.example.com and www2.exemple.com

Any suggestions?

Thanks in advance

Franck
Reply With Quote
Sponsored Links
  #2  
Old 8th March 2009, 16:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by Franck View Post
1. In the balancer manager interface one can set up route Redirects in case of failover. However if the Apache load balancer restarts, the settings are lost. Is there any way of making them persistent?
Not sure. Maybe one can add this directly to the Apache configuration?


Quote:
Originally Posted by Franck View Post
2. On the 2 front end servers I have several vhost. Like this:

Server 1:
<VirtualHost *:80>
ServerName 172.18.2.40
...
</VirtualHost>
<VirtualHost *:80>
ServerName www1.example.com
...
</VirtualHost>

Server2:
<VirtualHost *:80>
ServerName 172.18.2.41
...
</VirtualHost>

<VirtualHost *:80>
ServerName www2.example.com
...
</VirtualHost>

I have balanced the 2 vhost associated with the server's local IPs addresses:
BalancerMember http://172.18.2.40:80 route=http1
BalancerMember http://172.18.2.41:80 route=http2
And it works fine. However I now would like to balance (btw still on port 80) www1.example.com and www2.exemple.com

Any suggestions?
You can add this to each vhost that you want to balance.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 8th March 2009, 17:36
Franck Franck is offline
Junior Member
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks Falko

On #1 what syntax would u use?

On #2, that's assuming you have DNS entries setp up (i.e. public addresses). I was wondering if you could do that just by staying on LAN and somehow loadbalance specific vhost as opposed to private IP addresses
Reply With Quote
  #4  
Old 9th March 2009, 14:07
Franck Franck is offline
Junior Member
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok #2 was pretty stupid on my part. I edited /etc/hosts and voila!

That leaves me with question #1 persistent failover load balancer settings

Thanks for any input
Reply With Quote
  #5  
Old 9th March 2009, 18:06
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by Franck View Post
That leaves me with question #1 persistent failover load balancer settings

Thanks for any input
Not sure. Maybe you can do something with the environment variables? http://httpd.apache.org/docs/2.2/mod..._balancer.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 21st March 2009, 02:20
Franck Franck is offline
Junior Member
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

Ok I found out

<Proxy balancer://mycluster>
BalancerMember http://fr1.ndd.com:80 route=http1 redirect=http2
BalancerMember http://fr2.ndd.com:80 route=http2 redirect=http1
ProxySet lbmethod=byrequests
</Proxy>
Reply With Quote
The Following User Says Thank You to Franck For This Useful Post:
falko (21st March 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPconfig vhosts apache mod and/or fcgi, php ... hrvbid Feature Requests 1 8th June 2008 12:50
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 20:58
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
apache vhosts messed up whitty Installation/Configuration 9 4th June 2006 10:38
Problem with the installation of Dokeos (LMS) in ISPConfig jofranco General 4 28th April 2006 00:45


All times are GMT +2. The time now is 21:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.