1. both servers have Apacheapt-getinstallapache22 installed. both servers have Rsyncapt-getinstallrsync3 installed. in ServerA, use cron for planning crontab-e to enter the editing mode, and enter the following content, which means that the synchronization will be executed every 5 minutes */5 * rync-avzhesshroot @ machinenam
1. Apache is installed on both servers.
Apt-get install apache2
2. Rsync is installed on both servers.
Apt-get install rsync
3. Use cron in ServerA for planning
Crontab-e
Enter the editing mode, and enter the following content, which means synchronization is performed every 5 minutes.
*/5 * rync-avzhe ssh root@machinenameServerB.domainname.com:/var/www // var/www/
4. Modify the/var/www/index.html content of ServerB.
5. Check that the content of/var/www/index.html of ServerA is updated to the same content as that of ServerB.