Ali cloud Centos7 installation svn and configuration explanation

  • 2021-01-06 00:49:49
  • OfStack

1. Install svn server


yum install subversion

2. Create an svn repository (optional)


 // create 1 a svn directory 
mkdir -p /svn/repos
 // Change the directory permissions to 777
chmod -R 777 repos
 // create 1 a svn Version of the warehouse first(first You can call it whatever you want )
svnadmin create /svn/repos/first

3. Now we need to change the three configuration files in this directory (no Spaces after keys).


 // Go to the version repository directory you just created 
cd /svn/repos/first
// Configure the path to the repository information and user files and user password files, and the repository path 
vi svnserve.conf 
// the 
# anon-access = read
# auth-access = write
# password-db = passwd
// this 4 Okay, the front one # Numbers and Spaces are removed 
// to none
anon-access = none
auth-access = write
password-db = passwd
// Change to your own repository 
realm = first
// Save the exit 
(2)vi authz  // file , create svn Permissions for groups and group users 
[groups]
 // create 1 a first Group and formulate two users ddl and shl
first = ddl,shl
// Specify permissions under the root directory 
[/]
//first Group user permissions are read and write 
@first = rw
// Other users have read access only 
* = r
// Save the exit 
(3) vi passwd // Create or modify user passwords 
[users]
// The user is called gep The user's password is 123456
ddl = 123456
// . 
shl = 123456
// Save the exit 

4. Then you need to set the bootstrap

vi /etc/rc.local

Open the bootstrap file with the following contents


#!/bin/sh
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
//  Add the following 1 line 
svnserve -d -r /usr/local/svnRepo/first
// Save the exit 

Find all processes started by svn


ps aux |grep 'svn' 

Kill and start svn

Start svn (can put this in/etc/local/rc local file, since the launch of implementation boot)


svnserve -d -r /usr/local/svnRepo/first 

SVN repository starting way, now svnRepo first, test below two repository

1: Single repository startup


svnserve -d -r /usr/local/repos/first

2: Multi-version library startup


svnserve -d -r /usr/local/repos

The difference lies in the directory specified by the boot parameter -r in the command to start svn.

4. Limiting different users' operating privileges on different repositories, modify the authz file under the directory conf in the repository (there can be no space after the key value)

Take the example of configuring the first version library


vi authz
[groups]
company = user1,user2
[first:/]    // Specifies the permissions under the repository and directory 
@company = rw  //company Group user permissions are read and write 
* = r   // Other users have read access only 
// Save the exit 
vi passwd // Set the user account and password of the group 
[users]
user1 = 123456
user2 = 123456

5. Client access

Assume that the client uses tortoiseSVN

Open the repository browser and enter the address svn:// your svn server ip:3690

Enter username ddl password 12345

create forder, add forder, create forder, add forder

conclusion


Related articles: