Install svn
yum -y install subversion
Configuration
Create a repository directory
mkdir /www/svndata
svnserve -d -r /www/svndata
Create a new Subversion project
svnadmin create /www/svndata/oplinux
Configure to allow user rsync access
cd /www/svndata/oplinux/conf
vi svnserve.conf
anon-access=none
auth-access=write
password-db=passwd
Note: There can be no spaces in front of the modified file, otherwise there will be an error when starting the svn server
vi passwd
[ users]
#< User 1> = <Password 1>
#< User 2> = <Password 2>
david=123456
===============================================================
Set the web server root directory to /www/webroot
checkout an SVN
svn co svn://localhost/oplinux /www/webroot
Modify permissions for WEB users
chown -R apache:apache /www/webroot/oplinux
cd /www/svndata/oplinux/hooks/
cp post-commit.tmpl post-commit
Edit post-commit and add the following at the end of the file
export LANG=en_US.UTF-8
SVN=/usr/bin/svn
WEB=/www/webroot/
$SVN update $WEB –username rsync –password rsync
chown -R apache:apache $WEB
Increase script execution permissions
chmod +x post-commit
Recommended Posts