One of the most important part of web hosting business is backing your customer data. In this part of your tutorial how we can achieve it. The web hosting server software that I have chosen is Kloxo, as it is open source and free. To have off-site backup, we have chosen Crashplan, as it  provides the best option for servers (they call it headless client) and reasonably prices as well. The OS used is CentOS, as it is the most common OS for servers and you will get all required packages and software. I assume you have already setup the web hosting server and below is the procedure to replicate the server in case of any disaster and the server is done. I havent used Rsync there as I’ve offsite backup. You are go ahead with rsync if you are comfortable with it.

Setting up Off-site Back with Crashplan in your Backup server

Below are the commands for downloading and installing the crashplan in your server. For more documentation, please visit http://forum.synology.com/wiki/index.php/CrashPlan_Headless_Client

wget http://download.crashplan.com/installs/linux/install/CrashPlan/CrashPlan_3.4.1_Linux.tgz
tar -xvf CrashPlan_3.4.1_Linux.tgz
cd CrashPlan-install
./install.sh 
 /etc/init.d/crashplan start

 Install Kloxo in Backup Server

We will install Kloxo server as master as if case of emergency it can treated as main server. Kloxo slave is different option when it comes in backup.

# su - root
# setenforce 0
# wget http://download.lxcenter.org/download/kloxo/production/kloxo-installer.sh
# sh ./kloxo-installer.sh --type=master

Restore Clients and Domains with Database

First we need to create a backup image in the main kloxo server. This will create a *.tgz file in the directory. The copy the files using scp

/script/backup --class=client --name=admin
scp -r backup.tgz root@backupservice:/root/

Now we will restore clients. Though this is time consuming its the best process to follow as taking whole admin restore copies the IP, DNS  and other stuff from main server, so backup server does not function properly.

Use putty (in windows) or ssh in Mac to connect Crashplan engine to your backup server.  Putty configuration: Open putty -> give your backup server address. Click SSH -> Tunnels  -> Source port 4200 and destination localhost:4243 and add. Now connect and login user your crashplan account.

Copy resource plan using Crashplan Home -> restore -> main server name and crash plan central. Restore 3 files named resourceplan from location /usr/lib/mysql/kloxo in original location with original permission.

Here is the whole admin restore but I wont suggest to use it.

/script/restore --restore --accounts=all <backup-file-path>

Here is the process of individual clients and domain

 cd /usr/local/lxlabs/kloxo/httpdocs/

 lphp.exe ../bin/common/restore.php --restore --accounts=domain:domain.com,client:clientname <backup-file-path>

Login to kloxo admin (backupserver:7778) and move to Clients -> Client name -> Manage DNS. Rebuild the DNS with existing dns pool template. Browse the main server client DNS and add anything that is missing in this DNS but make sure you use backup server ip.

Leave a Reply

Your email address will not be published.