Detailed explanation of SVN server configuration process under Linux

This article mainly explains the method of creating SVN library under Linux.

SVN installation

The following mainly introduces the Linux operating system installation and SVN server installation instructions, taking the Centos 6.2 system as an example. Since the Centos operating system comes with the svn installation package, it does not need to be downloaded.

Install CentOS system

1) Insert the CentOS installation CD, select the first item: Insert picture description here
2) Skip the media test steps, as follows: Insert picture description here
3) Select English language (the default is OK), "Basic Storage Devices" (the default is OK), and then install all the way as the default . To the step of selecting components, if you want apache service, you can operate the options as follows [After the selection is completed here, the system will install the relevant by default].
Insert picture description here

4) After selecting, proceed to the next installation, and restart after installation.

Install svn

1) Mount the CD, use yum to install (yum is indeed very convenient, don’t worry about dependent packages), open a terminal, and follow the steps below:

[root@svn ~]# mkdir /media/cdrom

[root@svn ~]# mount /dev/cdrom /media/cdrom/

//Mount the CD

[root@svn ~]# yum --disablerepo=* --enablerepo=c6-media install mod_dav_svn

//Use yum to install the SVN server installation package

2) During the installation process, there are two places where you need to enter "y"

Transaction Summary

===============================

Install download size:2.5 M

Installed size:12M

Is this ok [y/N]: y

Downloading Packages:


From :/etc/pki/rm-gpg/RPM-GPG-KEY-CentOS-6

Is this ok [y/N]: y

3) After the installation is successful, it will appear:

Installed:

mod_dav_svn.i686 0:1.6.11-2.el6_1.4

Dependency Installed:

libproxy.i686 0:0.3.0-2.el6 libproxy-bin.i686 0:0.3.0-2.el6

libproxy-python.i686 0:0.3.0-2.el6 neon.i686 0:0.29.3-1.2.el6

pakchois.i686 0:0.4-3.2.el6 subversion.i686 0:1.6.11-2.el6_1.4

Complete!

4) Check whether the svn installation is successful

[root@svn Packages]# svn --version

svn, version 1.6.11 (r934486)

//The above information shows that SVN1.6.11 version has been installed successfully

Create SVN project library
Create a test project library

[root@SVN /]# mkdir /svn

//Create a svn folder in the root directory

[root@SVN ~]# svnadmin create /svn/test

//Create a test library in the /svn path.

[root@SVN ~]# cd /svn/test

[root@SVN test]# ls

conf db format hooks locks README.txt

//Check these files under the "/svn/test" path, indicating that they have been created successfully

SVN permission configuration

After creating the svn project library, you need to set the permissions of the project library as follows:

[root@SVN conf]# vi /svn/test/conf/svnserve.conf

[general]

anon-access = read

auth-access = write

password-db=passwd

authz-db=authz

realm=/svn/test

//In the svnserve.conf configuration file, the above content needs to be modified. The parameter configuration is as follows:

anon-access: Define the access permissions of unauthorized users. There are three ways: none, read, write, set to none to restrict access, read is read-only, write is read and write permissions, and the default is read.

auth-access: Define the access permissions of authorized users. There are three ways: none, read, write, set to none to restrict access, read is read-only, write is read-write permissions, and the default is write.

password-db: Define the name of the file to save the user name and password, here is passwd, which is located in the same directory as the file.

authz-db: Define the name of the file that saves the authorization information, here is authz, and it is located in the same directory as the file.

realm: Define the "authentication namespace" that the client is connected to. Subversion will display it in the authentication prompt and use it as a key for the credential cache.

Create SVN login user

Set the user and password of the project library staff in the passwd configuration file

[root@SVN conf]# vi /svn/test/conf/passwd

[users]

user1=123456

user2=123456

u1 = 123456

u2=123456

Configure SVN permissions

The configuration for setting login svn permissions is as follows:

[root@SVN conf]# vi /svn/test/conf/authz

[groups]

tester = user1,user2 //means user1, user2 in the tester group

develop=u1,u2 //Members u1, u2 in the develop group

[test:/] //This means project library permission setting

@tester = rw //Indicates that the tester group user of the test library has read and write permissions

@develop = r //Indicates that the test library develop group user has read-only permission

Restart the SVN project library

[root@SVN conf]# svnserve -d -r /svn //Restart the SVN project library

[root@SVN conf]# ps x|grep svn //If the following process appears, the restart is successful

2169 ? Ss 0:00 svnserve -d -r /svn

2171 pts/0 S+ 0:00 grep svn

[root@SVN conf]# killall svnserve //Kill svnserve service

SVN server configuration example

Create the test project library according to the above steps. The tester group members are user1, user2, and the permissions are read and write; the develop group members u1, u2, and the permissions are read-only.

(1) For user1, use the SVN client to log in to the SVN server, as shown in the following figure: Insert picture description here
Note: When logging in, directly enter the new project created after the address.

(2) The login is successful. Upload the test.txt file and modify the txt file name. Can read and write operations.

(3) Log in as user u1, you can only view the test library. No operations can be performed.

At last:

You in the future will definitely thank yourself for your hard work now!

Recommend a software testing technology exchange group to everyone: 1079636098 group friends receive free of charge

May you and I meet and you will find something! Welcome to follow WeChat public account: programmer Yifan

1. Receive a 216-page software test engineer interview book for free.

2. Software testing learning route and corresponding video learning tutorials are free to share!

Guess you like

Origin blog.csdn.net/qq_42434318/article/details/112863038