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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux course in 5 Days

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.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on 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:

      @Gustavo,

      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?

        -PS.
        Sorry for my bad english…

        • Ravi Saive says:

          @Gustavo,

          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:

    Hello,
    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:

      @Ranjan,
      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 http://linuxsay.com 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 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's