I have a few named vhosts on my apache2 debian server and I want to have a mirror server that can pickup as soon as the first server goes down. We can assume I have total control over both servers and /www data on both servers is regularly and incrementally synchronized using rsync.

I can see ways of doing it at the DNS level, but I'd like to have a community input on that. Are there any solutions for achieving this out there already?



If both server are on the same subnet, you probably want to look for Heartbeat this will make server2 to take server1 IP of server1 fail. A simple example is http://www.linux-ha.org/GettingStarted/Apache

  • For a simple "A dies start B" solution, Heartbeat is what your looking for. If your looking to get into load balancing, then look at LVS. – David Jun 16 '09 at 1:06

IPVS and keepalived are the combination to use. Depending on your configuration you can use both servers as long as they work and then just use one if the other one is failing.

Typically you should have redundant load balancers and then any number of webservers behind those.

You can even configure them to serve a static "FailWhale" page, however the configuration is not that simple, YMMV.


Another possibility is to use UCARP (http://www.ucarp.org/):

UCARP allows a couple of hosts to share common virtual IP addresses in order to provide automatic failover.

Though beware that it works on the IP Level not on the Application Level! However a pro is that it all runs in Userspace, setup is very easy and it's compatible with UCARP versions running on different plattforms (i.e. the main server could be Linux and your Slave runs Solaris or Windows or whatever).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.