安装SVN
yum install subversion mkdir /svn svnserve -d -r /svn/ vi /etc/rc.local 在最下面一行末尾添加 svnserve -d -r /svn/ 配置SVN svnadmin create /svn/shop cd /svn/shop/ vi conf/authz 将 # [/foo/bar] # harry = rw # &joe = r # * = 改为 [/] shop = rw # &joe = r # * = vi conf/passwd 将 [users] # harry = harryssecret # sally = sallyssecret 改为 [users] shop = shop # sally = sallyssecret vi conf/svnserve.conf 将 # anon-access = read # auth-access = write 改为 anon-access = none auth-access = write 将 # password-db = passwd 改为 password-db = passwd 将 # authz-db = authz 改为 authz-db = authz 将 # realm = My First Repository 改为 realm = shop app 初始化SVN cd /home/ svn co svn://127.0.0.1/shop --username=shop --password=shop 设置代码自动更新 cd /svn/shop/hooks/ mv post-commit.tmpl post-commit chmod a+x post-commit vi post-commit 删除 REPOS="$1" REV="$2" mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf 增加 svn update /home/shop/ --username=shop --password=shop chown -R nobody /home/shop/