Multi-user assignment for SVN multiple projects under Linux

Source: Internet
Author: User

The installation steps are as follows:

1, yum install Subversion2, enter RPM-QL subversion to view the installation location, such as:


Enter Svn–help to see how SVN is used

Demand
Development server Set up the SVN server, it is not possible to manage only one project, how to do not in one project developers can not access the code in other projects, do a good job of technical secrecy.
The code warehouse has three warehouses: project1,project2,project3
Suppose there are 6 people: Eg1,eg2,eg3,eg4,eg5,eg6
EG1,EG2, can only access Project1;
EG3,EG4, can only access project2;
Eg5,eg6, can only access project3;

3. Create SVN repository Directory

Mkdir/var/svn
Cd/var/svn
Create three code warehouses
Svnadmin Create Project1
Svnadmin Create Project2
Svnadmin Create Project3

After executing the command, the following file is generated Project1

Enter the Conf directory (the SVN repository configuration file)
Authz file is a permission control file
passwd is the account password file
Svnserve.conf SVN service configuration file

4. Create a new directory unified administrative user rights

Mkdir/var/svn/conf
Copy two rights profiles to the/VAR/SVN/CONF path to manage all code warehouses uniformly
Cd/projcet1/conf
CP Authz passwd/var/svn/conf

5. Modify the configuration file

VI svnserve.conf
Open the following notes ( and delete the spaces after the # ):
Anon-access = None
auth-access = Write #授权用户可写
PASSWORD-DB =/var/svn/conf/passwd #使用哪个文件作为账号文件 Uniform use of password files
Authz-db =/var/svn/conf/authz #使用哪个文件作为权限文件
Realm = Project1 # certified space name, repository directory permissions domain name, it is important to write your project name

And also changed the svnserve.conf of Project2.
Anon-access = None
auth-access = Write
Password-db =/var/svn/conf/passwd
Authz-db =/var/svn/conf/authz
Realm = Project2

And also changed the svnserve.conf of PROJECT3.
Anon-access = None
auth-access = Write
Password-db =/var/svn/conf/passwd
Authz-db =/var/svn/conf/authz
Realm = Project3

6. Modify the two Rights Management files:

VI passwd
User name = password
[Users]
EG1 = 123
EG2 = 123
EG3 = 123
EG4 = 123
EG5 = 123
EG6 = 123
Save

Note: Changes to the user profile take effect immediately without restarting the SVN service.

VI Authz
[Groups]//group
admin = eg1,eg2
Guest = Eg3,eg4
Guest1 = Eg5,eg6
[/]
* = #以上没有定义的用户都没有任何权限 (add your own root account)

[project1:/]//access control of Engineering 1, guest1,2 inaccessible
@admin = RW

[project2:/]
@guest = RW

[project3:/]
@guest1 = RW

Note: Changes to the permissions profile take effect immediately and do not have to restart SVN.

7. Start the SVN service

/usr/bin/svnserve-d-r/var/svn/

Note: Do not use the system-provided/etc/init.d/svnserve start to start, because the system default startup script does not use the –r/svn/project parameter to specify a resource. In this case, the SVN service is started, and the client connection will prompt "Svn:no repository found in ' Svn://192.168.11.229/project '" error.

The default SVN server port is 3690.

Kill SVN Service:

Ps-ef|grep SVN

Root 4642 1 0 16:08? 00:00:00 svnserve-d-r/var/svn/

Root 4692 3676 0 16:13 pts/2 00:00:00 grep svn

Kill-9 4642

To use the/etc/init.d/svnserve script, you can modify the start () function section as follows:

Start () {

[ -x $exec ] || exit 5[ -f $config ] || exit 6echo -n $"Starting $prog: "daemon --pidfile=${pidfile} $exec $args -r /var/svnretval=$?echo[ $retval -eq 0 ] && touch $lockfilereturn $retval

}

Complete

8. Testing on Windows

Create a new test folder, and under that folder, right-click the SVN Checkout (to install TORTOISESVN beforehand):
Svn://192.168.1.12/project1
Svn://192.168.1.12/project2
Svn://192.168.1.12/project3

Problem: Can't connect?
Workaround:
Because: When you modify a svnserve.conf file. Note that when you unpack the note, you also want to delete the space after the #. That means all the overhead.
Then the authentication failure is to pay attention to the previous [/]. And then restart the SVN.

Problem: SVN log file display time is 1970-01-01 No data
Workaround:
This issue occurs primarily in the setup of Anon-access access permissions in the Svnserve file.

Anon-access
Control permissions for non-authenticated users to access the repository. The values range from "write", "read" and "none".
That is, "write" is readable and writable, "read" is read-only and "none" means no access.
Default value: Read

Anon-access = None, follow the comments in the document: Prohibit all anonymous access, that is, if the user is not open access in authz-db, is not allowed to read and write the version of the log, the system to read and write to the log also included in the forbidden scope of access,
When viewing the log, the date of occurrence appears as 1970-01-01, and the log information shows no data. That's why.
So when you set access permissions in Svnserve, set it to Anon-access = read, read-only mode. In this case, the log file can be displayed as normal.
But after the pro-test should be set to Anon-access = None

Question: command line mode connection, prompt Svn:no repository found in ' Svn://192.168.11.229/project ' error?

WORKAROUND: The-R/VAR/SVN parameter is not used when starting the SVN service and does not indicate the specific path of the repository. Use the # svnserve-d-r/var/svn/command to start it, and do not use the/etc/init.d/svnserver script.

Question: "Svn:authorization failed" error when executing command # SVN co svn://192.168.11.229/project?

Workaround: The general reason for this authorization failure is from the configuration of the Conf/authz file

Multi-user assignment for SVN multiple projects under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.