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
Install SVN and configure through yum in centos