Linux Build SVN server

Source: Internet
Author: User
Tags svn client server port tortoisesvn

Got a server, and now want to do something, so the whole SVN on top, is familiar with the operation of the SVN process

The following contents are reproduced from:

https://yq.aliyun.com/articles/6693

--------------------------------------------------

Linux Build SVN server

Shen Xiaojin Date: August 5, 2014

1 Installing SVN

Official website Download: http://subversion.apache.org/packages.html

SVN client: TortoiseSVN, official website download: http://tortoisesvn.net/downloads.html

Yum Install Subversion

1. Create a new directory to store all SVN files

mkdir /SVN

2. Create a new resource warehouse

# svnadmin create/svn/ls /svn/project/

Conf db format Hooks Locks README.txt

Directory Use Description:

L Hooks directory: directory where hook script files are placed

L Locks Directory: The directory used to place Subversion db lock files and Db_logs lock files to track the clients accessing the vault

L Format File: is a text file with only an integer in it, indicating the version number of the current vault configuration

L conf Directory: is the configuration file of this warehouse (user access account, permissions, etc.) of the warehouse

3. Configure the SVN service configuration file svnserver.conf file

VI /svn/project/conf/svnserve.conf

Note:

Tools such as the Vim editor can be used here

The use of the Vim editor is

After opening the file, press the "I" key

The cursor is positioned to the appropriate location to modify

Then press "ESC" and enter ": Wq"

Save exit

Specifically, you should check the usage instructions of vim.

[General]

Anon-access = None

auth-access = Write

Password-db =/svn/project/conf/passwd

Authz-db =/svn/project/conf/authz

Realm = My Test Repository #这是个提示信息

Save

4. Add two access users and passwords

vi /svn/project/conf/passwd

[Users]

Xiaoran.shen = 123456

Test1 = 123456

Test2 = 123456

Save

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

5. Configure the authorization file for the new user

VI /svn/project/conf/authz

[Groups]

admin = Xiaoran.shen,test1

user = Test2

[/]

@admin = RW

@user = R

* =

Save

Format Description:

Repository directory format:

[< Repository >:/project/catalog]

@< user Group Name > = < permissions >

< user name > = < permissions >

/indicates that permissions are set on all subdirectory scopes under the root directory (that is, the/svn/project directory);

[/ABC] means setting permissions on the ABC project in the repository;

Create an admin group with group members including Xiaoran.shen and Test1

Create a user group with only TEST2 members;

The admin group has read and write access to the directory;

Single user test2 have read and write permission;

*= indicates that in addition to the permissions set above the user group, all other users set the empty permissions, the null permission to prohibit access to this directory, it is important to add.

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

6. Start the SVN service

Svnserve-d-r/svn/project/

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/svn/project/

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 6

Echo-n $ "Starting $prog:"

Daemon--pidfile=${pidfile} $exec $args-R/svn/project

Retval=$?

Echo

[$retval-eq 0] && Touch $lockfile

Return $retval

}

Complete

2 Client connection using client 2.1 using Windows

Open the TortoiseSVN Repository Browser tool

In the URL, enter:

svn://192.168.11.229 Enter, prompt for user name and password

2.2 Using the command line under Linux

# SVN Co svn://192.168.11.229

3 FAQ3.1 command line mode connection, prompt Svn:no repository found in ' Svn://192.168.11.229/project ' error?

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

3.2 "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

The correct configuration is as follows:

[Groups]

admin = Xiaoran.shen,test1

user = Test2

[/]

@admin = RW

@user = RW

* =

Save

Linux Build SVN server

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.