Data Networking/Fall 2014/Shalini/Web Server Backup
WEB SERVER BACKUP
editBackup is the process of saving the data in a different location, so that it can be used in the case of data loss. Basically, if our web server lose the data or there is a situation of extra load on the web server, we can use this back up data. This means the backup data will help in retaining the data and in load balancing.
In our project we have made a backup of our web server in the DNS server and have scheduled the back up every 1 hour. This means that the data of web server will be copied to back up location after every one hour. Therefore, if a situation arises, we will have our data saved at the replicated location.
Configuring the Backup:
editAs, we are making the back up in the DNS server, it is necessary for us to run apache on both the machines. This will make it run like a web server over other Linux machine. Once we have apache server installed on our machines, we can follow the procedure used for back up.
1. Installing the Apache in backup server
sudo apt-get install apache2
This will install the apache server on our machine.
2. Install the Rsync (In webserver and backup server)
Rsync is used to manage the back up on the server machine.
sudo apt-get install rsync
3. To get the back up within other directort of web server
Sudo rsync –avz –progress / var/www/ /path of backup directory/
4. Install the SSH Rsync ( In webserver and back up server)
sudo apt-get install ssh rsync
5. To put the backup in another server (To be executed in the backup server)
sudo rsync -avz –progress -e ssh pranay@192.168.3.60 /var/www/ /path of back up directory/
6. To schedule the back up every 5 minutes, Crontab is used
sudo crontab -e 60 00 *** rsync -avz –progress -e ssh pranay@192.168.3.60 /var/www/ /path of back up directory/
Testing:
editThe commands are executed in the backup server and the copy of the web server file was successfully transferred to the specified path of the backup server. Certain changes were made to the web server file and the scheduling command was executed in the backup server. After a period of 5 minutes, the new file of the web server was transferred to the specified back up location.