1. Environment
Centos5.5
2. Install svn
Yum-y install subversion
3. Configuration
Create a version Library Directory
Mkdir/www/svndata
Svnserve-d-r/www/svndata
4. Create a version Library
Create a new Subversion project
Svnadmin create/www/svndata/oplinux
Configure to allow rsync access
Cd/www/svndata/oplinux/conf
Vi svnserve. conf
Anon-access = none
Auth-access = write
Password-db = passwd
Note: there must be no space before the modified file; otherwise, an error occurred while starting the svn server.
Vi passwd
[Users]
# <User 1 >=< Password 1>
# <User 2 >=< password 2>
David = 1, 123456
5. Client connection
Svn co svn: // ip/oplinux
Password: 123456
========================================================== ======================================
6. To synchronize SVN and WEB, you can CO it or directly configure it in the repository.
1) set the root directory of the WEB server to/www/webroot.
2) checkout SVN
Svn co svn: // localhost/oplinux/www/webroot
Modify permissions to WEB users
Chown-R apache: apache/www/webroot/oplinux
3) Create a synchronization script
Cd/www/svndata/oplinux/hooks/
Cppost-commit.tmpl post-commit
Edit post-commit and add the following content 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
Add script execution permission
Chmod + x post-commit