WenderHost

(865) 270-6715
or email us

Mirror a Dynamic Website on a CPanel/WHM Server

Step 2: Setting up public key ssh authentication
Your mirror server will need to use public key ssh authentication to talk to your production server. To set this up, you will need to ssh into your mirror server and enter the following commands:

  1. Create your public and private key pair by typing: ssh-keygen -t dsa and press Enter.
  2. The key generator will ask you where you want to save your key. Press Enter to accept the default.
  3. Next, the generator will prompt you to enter a passphrase. Press Enter without entering a passphrase. (You must leave this blank to allow for the automated tasks we will setup in steps 3 and 4.)
  4. Finally, you will need to copy your public key to your production server. Do this by entering the following command (you will need to enter your password just this one time after you press Enter):
    • cat ~/.ssh/id_dsa.pub | ssh user@serverIP "cat - >> ~/.ssh/authorized_keys"
      user = the username of your production server
      serverIP = the IP address of your production server

Finally, you can test your setup by entering: ssh user@serverIP. If you've set this up correctly, you shouldn't have to enter any login details, and now you are ready for Step 3: Using Rsync to mirror data between servers.

If you need further assistance setting up public key authentication, the steps listed above were gleaned from this post at LinuxQuestions.org.

4 Responses to “Mirror a Dynamic Website on a CPanel/WHM Server”

  1. Naseer Khan says:

    Hi,
    Please could you tell me if you have ever done mirroring for the plesk web servers.
    Thanking you.
    Regards,
    Naseer.

  2. Davi Souza says:

    This is for ressellers, how to backup entire dedicated server with cpanel and whm???

    the sql sync isn“t good enough, imagine if i need to create all database of accounts??? is it possible to copy all information between the servers???

    thanks - but at all is very good tutorial....

  3. AndyW says:

    Michael, I find your article very informative and helpfull. Thank you very much for same.

    Was wondering since you posted it on 2007, how has the setup performed since then? Are you still using it or have you moved to a more advanced setup.

    Just want to get your production experience of it, before I implement it on a bunch of websites.

    Thanks in advance.

  4. Peter says:

    If the server still asks for password then you need to check the following permission in your server.

    * Change the permissions of .ssh to 700
    * Change the permissions of .ssh/authorized_keys2 to 640

    It took me 2 days to figure this out.

Leave a Reply

Copyright © 2007. All Rights Reserved.
WP Full Site Theme modified by Michael Wender. • Log in.