#svn安装
Yum install-y Subversion
Uninstall SVN old version
Yum remove-y Subversion
wget http://pkgs.repoforge.org/subversion/subversion-1.7.4-0.1.el6.rfx.x86_64.rpm
Install new version
RPM-IVH subversion-1.7.4-0.1.el6.rfx.x86_64.rpm
Create the SVN root directory
Mkdir/svndata
Create SVN public configuration directory
Mkdir-p/usr/local/subversion/conf
Cd/usr/local/subversion/conf
editing user Files Authz
The contents are as follows:
[Groups]
Backend=zty
[/]
Whh=rw
@backend =RW
Explain:
Backend represents a user group, @backend =RW indicates that the user group has read and write permissions.
WHH is used to run the hook script user, the name can be taken casually, the following will be said Hook script.
If you need to add user Zhang, modify the Backend=zty, add it later, multiple users separated by commas, the effect is as follows:
Backend=zty,zhang
Edit Password File passwd
The contents are as follows:
[Users]
WHH = whh
Zty = zty123
Explain:
The left side of the equals sign is the user, the right is the password
Create bin directory
Mkdir-p/usr/local/subversion/bin
Link file
Ln-s/USR/BIN/SVN/USR/LOCAL/SUBVERSION/BIN/SVN
Create the SVN root directory
Mkdir/svndata
Create SVN log directory
Mkdir/var/log/svn
To create a DTS Project checkout directory, this directory must be empty.
The general SVN server and the Web server are on the same server.
The root directory of the Web server is/www, so the path that the DTS project checks out from SVN is also in the/www directory.
Once the client submits the code and accesses the page, it can see the effect.
Mkdir/www/dts
Create a project
Cd/svndata
Svnadmin Create DTS
Editing a configuration file
cd/svndata/www/dts/conf/
Editing a configuration file svnserve.conf
Clear All content
Write the following content:
[General]
Anon-access = None
auth-access = Write
Password-db =/usr/local/subversion/conf/passwd
Authz-db =/usr/local/subversion/conf/authz
Realm = Web
[SASL]
# USE-SASL = True
# min-encryption = 0
# max-encryption = 256
Specify the user and password profiles as public directories. If the new project is also specified as a public directory, only the files of the public directory need to be modified, and other related items can be accessed using the specified user and password.
In the case of a large number of projects and uniform personnel rights, it is necessary.
If the company has more than 60 projects, a new employee, to add an account, each project reconfiguration is very laborious.
If all are specified as public directories, then only the 2 files of Authz and passwd need to be changed.
Edit Hook file, default Post-commit file does not exist
Vim/svndata/www/dts/hooks/post-commit
The contents are as follows:
#!/bin/sh
/USR/LOCAL/SUBVERSION/BIN/SVN update--username whh--password whh/www/dts/>>/var/log/svn/dts.log
Set permissions
chmod 755/svndata/www/dts/hooks/post-commit
Here is an explanation of the role of the hook script.
When the client submits the file successfully, the Post-commit is executed automatically. Check out the updated code to the specified directory to ensure that the submitted code is consistent with the server.
Note that, do not directly in the server's specified directory, here refers to/www/dts/edit the file, otherwise the client submits the file, prompting for file conflicts.
Start SVN
Svnserve-d-r/svndata
Note that you must manually check out a copy, otherwise post-commit does not take effect
SVN Co file:///svndata/www/dts//www/dts/
Execute the command again
/USR/LOCAL/SUBVERSION/BIN/SVN update--username whh--password whh/www/dts/
Uploading code tests using SVN client
See if the server/www/dts/directory has uploaded files
This article is from the "Falling Star" blog, make sure to keep this source http://xiao987334176.blog.51cto.com/2202382/1708126
CentOS 6.5 x64 Install SVN