实验二命令参考
tar zxvf httpd... -C /usr/src && cd /usr/src/httpd*
./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-list --enable-cgi && make && make install

ln -s /usr/local/httpd/bin/* /usr/local/bin
cp /usr/local/httpd/bin/apache /etc/init.d/httpd
vim /etc/init.d/httpd
	chkconfig: 35 85 21 
service httpd restart

ln -s /media /usr/local/httpd/htdocs/yum

rm -rf /etc/yum.repos/*
vim /etc/yum.repos/aaa.repo
	[aaa]
		name=aaa
		baseurl=http://192.168.1.1/yum
		enabled=1
		gpgcheck=0

yum list

vim /etc/ssh/sshd.conf
	PasswordAuthentication  no
	PubkeyAuthentication  yes

ssh-keygen -t rsa
	scp ~/.ssh/id_rsa.pub  root@192.168.1.1:/usr/local/
	
mv /usr/local/id_rsa.pub ~/.ssh/authorized_keys

ssh root@192.168.1.1

vim /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = yes
address = 192.168.1.1
port = 873
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.log
hosts allow = 192.168.1.0/24
[www]
        path = /usr/local/httpd/htdocs
        comment = http
        read only = no
        dont compress = *.gz
        auth users = zhangsan
        secrets file = /etc/rsyncd_users.db
		
vim /etc/rsyncd_users.db
	zhangsan:123

rsync --daemon
netstat -anpt | grep rsync
	
tar zxvf inotify-tools-3.14.tar.gz -C /usr/src && cd /usr/src/ino*
./configure && make && make install

vim inotify_rsync.sh
	#!/bin/bash
	INOTIFY_CMD='inotifywait -mrq -e modify,create,attrib,move,delete /usr/local/httpd/htdocs'
	RSYNC_CMD='rsync -rlvz --delete --password-file=/etc/server.pass /share/ zhangsan@192.168.1.1::www'
	$INOTIFY_CMD | while read DIRECTORY EVENT FILE
	do
		if [ $(pgrep rsync | wc -l) -le 4 ] ; then
			$RSYNC_CMD
		fi
	done

vim /etc/server.pass
	123

为相对应的文件赋予权限

sh inotify_rsync.sh




记错了。。。。
是在客户端使用生成密钥对的命令

刚才有点其他的事情，现在继续


不用密码直接连接成功


由于我的电脑虚拟机无法拖拽文件，只能挂在
是权限的问题
有一个地方需要给权限
成功了
刚才是读不了用户列表中的信息

完成

