Four ways to implement web data synchronization in Centos

Source: Internet
Author: User
Tags inotify
Four ways to implement web data synchronization =========================================== ======== nfs enables web data sharing rsync + inotify for web data synchronization rsync + sersync faster and more resource-saving implementation of web data synchronization unison + inotify for two-way web data synchronization = ============================================================ 1. nfs achieve web Data Sharing & n

Four ways to implement web data synchronization

========================================================

Nfs for web data sharing

Rsync + inotify for web data synchronization

Rsync + sersync faster and more resource-saving for web data synchronization

Unison + inotify achieve two-way web data synchronization

========================================================

I. nfs for web data sharing

12345678910111213 [root@jie1 ~]# vim /etc/httpd/conf/httpd.conf########################################ServerName 172.16.22.1:80#DocumentRoot "/var/www/html" ServerName www.jie.comDocumentRoot  /web/htdocs</VirtualHost>#######################################[root@jie1 ~]# mkdir -pv /web/htdocs[root@jie1 ~]# Cd/web/htdocs # No webpage files on the server[root@jie1 ~]# ls[root@jie1 ~]#

3) rsync service configuration

* ***** Create The rsync configuration file and password file ************

Touch/etc/rsyncd. conf (rsync configuration file)

Touch/etc/rsyncd. pwd (user's password file)

Chmod 600/etc/rsyncd. pwd (the permission must be set to 600; otherwise, the backup will fail)

1234567891011121314151617181920212223242526272829303132 [root@jie1 ~]# vim /etc/rsyncd.conf############vim /etc/rsyncd.conf########################################uid = nobody                    # Id of the backup, user IDgid = nobody                    # ID of the backup groupuse chroot = no                 # Banned from the source directorymax connections = 3             # Maximum number of connections. 0 indicates no limitstrict modes = yes# Check the permissions of the password filepid file= /var/run/rsyncd.pid  # Pid file of the running processlog file= /var/log/rsyncd.log  # Log file[htdocs]                        # Specify the name of the authenticated backup modulepath = /web/htdocs# Path of the directory to be backed upignore errors = yes# Ignore irrelevant IO errorsreadonly = no                  # If it is set to no, it can be passed to the corresponding directory on the server.write only = no                 # Set to no, indicating that the client can download fileshosts allow = 172.16.22.3       # IP address of the host that can connect to the rsync serverhosts deny = *                  # Set the host address to prohibit the connection to the rsync server. * indicates that all requests except those defined by hosts allow are rejected.uid = rootgid = rootauth users= backuper            # User name of the connection modulesecrets file= /etc/rsyncd.pwd# Path for storing the password file of the connection module User name#####################################################################[root@jie1 ~]# Vim/etc/rsyncd. pwd # user's password file#####################################################################backuper:pwd123        # Username: password#####################################################################[root@jie1 ~]# Chmod 600/etc/rsyncd. pwd # grant permissions to 600[root@jie1 ~]# chkconfig rsync on[root@jie1 ~]# chkconfig xinetd on[root@jie1 ~]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.