After installing SVN software, it is necessary to establish SVN library.
[root@Linux module ]# mkdir -p /opt/svn/repo
[root@Linux module ]# svnadmin create /opt/svn/repo
After executing the above command, the repo test library is automatically established. Looking at the folder /opt/svn/repo, we found that there are files such as conf, db, format, hooks, locks, readme.txt, which indicates that the svn library has been established.
Configure SVN code base
Enter the folder conf generated above and configure it.
[root@Linux module ]# cd /opt/svn/repo/conf
User password passwd configuration
[root@Linux password ]# cd /opt/svn/repos/conf
[root@Linux conf]# vim passwd
Modify passwd as follows:
[user]
# harry = harryssecret
# sally = sallyssecret
root=raykaeso
User name = password
So we established the password of root user, raykaeso.
All the above statements must be capitalized, and no spaces can be left, otherwise an error will occur.
Authorization control authz configuration
[root@Linux conf]# vi + authz
The purpose is to set which users can access which directories, and attach the following contents to the authz file:
# Set [/] represents all resources in the root directory.
[/] or [repl:/]
root= rw
This means that the root user has read and write access to all directories in the repo test library, and of course there may be restrictions.
If it's for your own use, just read and write.
All the above statements must be capitalized, and no spaces can be left, otherwise an error will occur.
Service svnserve.conf configuration
[root @ Linux conf]# vim SVN server . conf
Add the following:
[routine]
# Permission for anonymous access, which can be read, write or nothing. The default value is read.
Anonymous access = None
# Give authorized users write permission
Authorized access = write
# The path to the password database
Password -db=passwd
# Access control file
authz-db=authz
# Authentication namespace, subversion will be displayed in the authentication prompt, which will be used as the keyword of the certificate cache.
Domain =/opt/SVN/ repository
All the above statements must be capitalized, and no spaces can be left, otherwise an error will occur.
Configure firewall, SVN port is 3690.
[root @ Linux conf]# VI/etc/sys config/iptables
Add the following:
-A input -m status-status new -m TCP-p TCP-dport 3690-j accepted.
Restart the firewall after saving
[root@Linux conf]# service iptables restarted.
Start SVN
SVN server-d-r/opt/SVN/repo
Start SVN service
SVN server-d-r/opt/SVN/
Note: If multiple version management are started on a server at the same time, the startup path must be the root path of all project warehouses: for example
/opt/SVN/project 1/opt/SVN/project 2——————-& gt; /opt/svn/
Reference: CentOS 6.2 SVN Building (YUM device) -/226