We have 2 Apache Web-Servers which is getting replicated with rsync command, when the primary host is down, we manually change the IP and make it up.

Now we are trying to find way to do an automatic switchover/failover environment.

  • Firstly when I say failover that means when the primary website is down secondary website should start & act as Primary
  • Switch over means when we do a manual switch (Testing the ENV) the website Codes should be synced
  • For switching IP failover is must ON each server I have 2 Nic available for failover purpose
  • How do I sync the Codes after switching or failover vice versa for
    eg; If my primary is working fine and I have deployed some new codes on the live (primary) server. Here if I have sync it will make the changes in secondary. But after switching to secondary to live, I have updated the live with the new codes now how do I sync. Do I need to create a CRON on both the server or is there any way to for simple replication

Centos 6.7

Is there any solution for doing this?


2 Answers 2


For the failover part, you should possibly look into a "reverse proxy" or "load balancer" technology. With this, the content always gets delivered by one primary, or by all server, and if one fails, the other one takes over. Your syncing efforts may be solvable by using "git" with a repository external to all the web-servers. You may then update one particular server from the up-to-date version, test, and roll back if neccessary.


For the failover part, I recommend you LVS, HAProxy or Varnish.

As for keeping the two servers synchronised, and assuming they have files uploaded, I advise either you having a file server via NFS that is common to the two Apache web server front ends, or two Apaches replicated in real-time via DRDB.

You must log in to answer this question.