Recently, one of my clients asked me to mirror his web server. The only problem with this request was that I host his web site on my WHM reseller account, and his budget would only cover another shared hosting package. Mirroring one shared hosting server via another shared hosting server seemed possible; however, I knew that the budget constraints meant I would be piecing together my own solution…
Now a couple of months after his request, I am happy to report that I have successfully setup a mirror of my client’s CPanel/WHM server. My technique combines the right combination of service providers, public key ssh authentication, rsync, mysqldump, and DNS Failover switching.
In this tutorial I am going to show you how to mirror a web server using two shared hosting accounts. Our mirror web server will automatically backup all scripts, files, and databases on the production web server. In addition, this tutorial will also describe how to setup DNS fail over switching that will monitor the status of the production server and automatically switch the DNS to point to the mirror server should the production server fail.
As this technique involves five distinct steps, I have divided this post into the following sections: