How to build an SVN server under linux (centos7)

How to build SVN server under linux (centos)? Speaking of SVN server, everyone must know how to build SVN server under LINUX? So today I will share with you the idea of ​​​​building SVN server under linux (centos)!

Although it is very simple to build SVN on windows, the performance is not high, which is of course compared with linux. However, building SVN on linux is very cumbersome, so today this article will teach you step by step how to build on Centos SVN.

The installation steps are as follows

1. Installation

sudo yum install subversion

View installation location

sudo rpm -ql subversion

2. Create a repository

sudo mkdir -p /var/svn
sudo svnadmin create /var/svn/project_1

3. Configuration

Enter the conf directory (the svn repository configuration file)

  • The authz file is the permission control file
  • passwd is the account password file
  • svnserve.conf SVN service configuration file

1. Set the account password

sudo vim passwd

Add users and passwords in the [users] block, in the format: account=password, for example, junwei = junwei refer to the following for the complete content:

[users]
june = june
junwei = junwei

2. Set permissions

sudo vim authz

Add the following code at the end:

admin = junwei
[/]
@admin = rw

Refer to the following for full content:

[aliases]
[groups]
admin=june
user=june,junwei
[/]
@admin=rw
@user=rw

It means that the root directory junwei of the repository has read and write permissions to it.

3. Modify the svnserve.conf file

sudo vim svnserve.conf

Open a few comments below:

  • anon-access = read # Readable by anonymous users
  • auth-access = write #Authorized users can write
  • password-db = passwd #Which file is used as the account file
  • authz-db=authz #Which file to use as the authority file
  • realm = /var/svn/svnrepos # Authentication space name, the directory where the repository is located

Note: To configure the location, refer to the following for full details

[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = /var/svn/project_1
# force-username-case = none
[sasl]
# use-sasl = true
# min-encryption = 0
# max-encryption = 256

4. Start the svn repository 

sudo svnserve -d -r /var/svn

5. Test on Windows

Under a certain directory, right-click and select "SVN Checkout", enter it in the pop-up Checkout box svn://ip/project_1, click OK, and a prompt to enter the user name and password will pop up. After confirming, you can upload a file to test it.

Guess you like

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