svn configuration instructions under linux

After the successful installation of svn under linux, if the configuration is explained

svn server configuration:

1. Create a version library directory. The established version library directory and the installation directory are not in the same level directory (more than one can be established. After creating a new library, the following items need to be reconfigured. Note the difference between the installation directory and the version library directory. are all repository directories) 

mkdir –p /opt/svn/repository/projectname

Where /opt/svn/repository/ the parent directory of all repositories

projectname is the directory of a warehouse, you can create multiple warehouses in /opt/svn/repository/

2. Create the svn repository (corresponding to the above directory) 

svnadmin create /opt/svn/repository/projectname 

After executing this command, svn automatically adds the necessary configuration files in the repos directory. 

3. Modify the repository configuration file

vi /opt/svn/repository/projectname/conf/svnserve.conf

Each parameter function is described in the comments of the configuration file, and the configuration here is as follows: 

[general] 

anon-access = none # Make unauthorized users inaccessible 

auth-access = write # Make authorized users have write access 

password-db = /opt/svn/repository/projectname/conf/passwd # specify the password file path 

authz-db = /opt/svn/repository/projectname/conf/authz # access control file

realm = /opt/svn/repository/projectname # Authentication namespace, which subversion will show in the authentication prompt and used as a key to the credential cache. 

Others use the default configuration. Each statement must be written in the top box, and no spaces can be left on the left, otherwise an error will occur. 

Note: The realm parameter can also not be set (I tested it myself)

4. Configure the user: passwd file

Enter the following: 

[users] 

<user1> = <password1> admin = admin

<user2> = <password2> username2 = password2

More than one can be added, this is a username and password pair.

5. Configure permissions: authz file

Instruction introduction: This configuration file adopts the "path-based authorization" policy, the path is specified in square brackets, and the authorization for each user is listed below. Including read-only r, read-write rw. No user listed, access is not allowed. You can also group users. For details, please refer to the svn manual. The following is a simple example:

User group format:

    [groups]

    <user group name> = <user1>,<user2>

    Among them, a user group can contain one or more users, and the users are separated by commas.

    Repository directory format:

    [<Repository>:/Project/Directory]

    @<user group name> = <permission>

    <username> = <permissions>

    Among them, the inner part of the box number can be written in multiple ways:

     /, represents the root directory and below. The root directory is specified when svnserve starts, we specify /opt/svn/repository. In this way, / means to set permissions on all repositories.

     repos1:/, which means setting permissions on repository 1

     repos2:/abc, , indicates setting permissions on the abc project in repository 2

     repos2:/abc/aaa, , indicates setting permissions on the aaa directory of the abc project in repository 2

     The authority subject can be a user group, user or *. The user group is preceded by @, and * means all users. Permissions can be w, r, wr and null, null means no permissions.

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326311840&siteId=291194637