How to Sync Two Apache Web Servers/Websites Using Rsync

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Tarunika Shrivastava

I am a linux server admin and love to play with Linux and all other distributions of it. I am working as System Engineer with a Web Hosting Company.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

24 Responses

  1. GustavoChalco says:

    One question, what should I do with the user that I already created. In your crond its root who connect to the other server… :/

    • Ravi Saive says:


      You can use those newly created users to use for syncing files between two servers, as in my example I used root users to sync..

      • GustavoChalco says:

        That’s what I mean, for example if I want to sync Apache conf dir for bk, I need root privileges on the other server am right?

        Sorry for my bad english…

        • Ravi Saive says:


          That’s right, you need root privileges to sync core system files, normal users don’t have such privileges to copy/sync system configuration files..

  2. Nacho says:

    Thank you. I use Rsync to replicate between one web server and two slaves for balancing and works perfect. thank you for share. greetings from Argentina.

  3. Ranjan says:

    How backup server will handle traffic if first server will down? rsync command only sync to data from one to another. but how it will handle the traffic just need to know

    • Ravi Saive says:

      Yes rsync command only syncs data between two servers, it doesn’t programmed to handle traffic. If first server down in case, you need to manually point to slave server (backup server)

  4. @ndres says:

    What about Data Base replication? Nowadays most web sites uses databases.

  5. banker says:

    use KrojamSoft SyncFile it’s the best…

  6. Vlad says:

    I’m new to this. So apologize in advance for basic, dumb questions. Where do I enter these commands? Please give me specific steps. Do I have to login to my cpanel or WHM? Or is it something I can pull up from the FTP? Thanks in advance for your patience with my ignorant questions.

    • Ravi Saive says:

      The commands can be run on server level with direct root access. It will won’t work uner cpanel or WHM.

    • Marin Todorov says:

      Please submit your question in forum with your specific needs and we will be more than glad to hep you with that. I am asking to submit the question in there as this is the official TecMint support forum and we will be able to provide more detailed instructions in there.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 257,757
  2. 11,967
  3. 39,682

Are you subscribed?