Build an SVN code version server and an svn code
The company needs to build a SVN code version management server to manage all code assets;
Project Architecture
1. Environment Installation
[Root @ host_centos ~] # Yum-y install subversion mod_dav_svn
[Root @ host_centos ~] # Cat/etc/services | grep-color svn # View registered
Svn 3690/tcp # Subversion
Svn 3690/udp # Subversion
2. Create a version library directory
[Root @ host_centos ~] # Mkdir-p/vdb1/svn
[Root @ host_centos ~] # Svnadmin create/var/svn/code
[Root @ host_centos ~] # Svnadmin create/var/svn/resource
[Root @ host_centos ~] # Ls/var/svn/code/
README.txt conf db format hooks locks
3. modify the configuration file
Move the configuration file to the/vdb1/svn directory
[Root @ host_centos svn] # mv/vdb1/svn/code/conf/authz/vdb1/svn/
[Root @ host_centos svn] # mv/vdb1/svn/code/conf/passwd/vdb1/svn/
Modify the svnserve. conf file under code
[Root @ host_centos ~] # Vim/vdb1/svn/code/test/conf/svnserve. conf
Uncomment the following
Anon-access = none # anonymous users cannot read or write data
Auth-access = write # authorized users can write
Password-db =/vdb1/svn/passwd # Which file is used as the account file
Authz-db =/vdb1/svn/authz # Which file is used as the permission File
Realm = My test # Name of the authentication Space
Configure the user and password
[Root @ host_centos ~] # Vim/vdb1/svn/passwd
User1 = 123456
User2 = 123456
User3 = 123456
User4= 123456
User5= 123456
User6= 123456
User7 = 123456
Note: All content in this configuration file must be written in the top level; otherwise, an error is returned;
Configure user authentication Permissions
[Root @ host_centos ~] # Vim/vdb1/svn/authz
[Groups] # Group
Administrator group: admin_group = user1
Development Team: develps_group = user1, user2
Resource Group: resource_group = user3, user4
Product Group: product_group = user5, user6
UI group: ui_group = user7
Modify the svnserve. conf file under resource
[Root @ host_centos svn] # vim/vdb1/svn/resource/conf/svnserve. conf
Anon-access = none
Auth-access = write
Password-db =/vdb1/svn/passwd
Authz-db =/vdb1/svn/authz
4. SVN service operations
Run the command svnserve-d-r/vdb1/svn to start the svn service.
Run the following command to disable the svn service:
Ps-aux | grep svnserve # first check the process of this service
Kill-9 process # kill the process;
5. Notes for adding a project library later
To allow all users to access the version library with a unified password, you can add/var/svn/code/project/conf/svnserve. change the password-db = passwd authz-db =/vdb1/svn/authz path of the conf file to point to it;
6. Others
Set startup
[Root @ host_centos ~] # Chkconfig svnserve on
Other operations
Svn code library is migrated from one warehouse to another warehouse
1. Export projects include submitting logs
Svnadmin dump/var/svn/pnew/> pnew. svn
Pnew: name of the repository to Be Exported
2. Import
Svnadmin load code -- parent-dir new_admin <dd
Code: name of the new Warehouse
New_admin: folder name under the new repository