CentOS6.8 SVN server manages multiple projects, centos6.8svn
Requirement 1
Generally, the company has multiple projects. After setting up the SVN server, it needs to use SVN to prevent developers in other projects from accessing the code in other projects.
Hypothesis:
There are three projects: project1, project2, and project3
There are 6 developers: eg1, eg2, eg3, eg4, eg5, and eg6.
Eg1 and eg2 can only access project1;
Eg3 and eg4 can only access project2;
Eg5 and eg6 can only access project3;
Second Implementation
In the root path of the Repository: Assume It is/home/svnroot.
cd /home/svnroot
// Create three code repositories
svnadmin create project1svnadmin create project2svnadmin create project3
// Copy the two permission configuration files to the root path of the repository to manage all the code repositories in a unified manner.
cd /projcet1/confcp authz passwd /home/svnroot
// Open the configuration file
vim svnserve.conf
To:
Anon-access = none # prohibit Anonymous access auth-access = writepassword-db =/home/svn/passwd # Use the password file authz-db =/home/svn/authzrealm = project1 # permission domain name, it is very important to write your project name
Modify svnserve. conf of project2, and write the last line separately.
Anon-access = none # prohibit Anonymous access auth-access = writepassword-db =/home/svn/passwd # Use the password file authz-db =/home/svn/authzrealm = project2 # permission domain name, it is very important to write your project name
Modify svnserve. conf of project3 respectively. Same as above, write the last line separately
Anon-access = none # prohibit Anonymous access auth-access = writepassword-db =/home/svn/passwd # Use the password file authz-db =/home/svn/authzrealm = project3 # permission domain name, it is very important to write your project name
Modify two permission management files:
cd /home/svnroot
vim passwd
// Username = Password
[users]eg1 = 123456eg2 = 123456eg3 = 123456eg4 = 123456eg5 = 123456eg6 = 123456
vim authz
[Groups] # group admin = eg1, eg2guest = eg3, eg4guset1 = eg5, eg6 [/] # the Administrator has all the read and write permissions @ admin = rw * = [project1: /] # access control for Project 1, guest1, 2 inaccessible @ admin = rw or eg1 = rw eg2 = rw [project2: /] @ guest = rw or eg3 = rw eg4 = rw [project3:/] @ guest1 = rw or eg5 = rw eg6 = rw
3 restart
svnserve -d -r /home/svnroot
// Stop command
killall svnserve
4. Actual tests