Build a Linux SVN Server

Source: Internet
Author: User

Build a Linux SVN Server

1. One Ubuntu PC, preferably the latest stable Ubuntu version

2. Run the following command to install subversion:

Sudo apt-get update
Sudo apt-get install subversion

3. If the root path of the Code svn repository is/home/svnroot, run the following command to create a directory:

Sudo mkdir/home/svnroot

4. Create a code repository. Assume that the repository name is example.

Cd/home/svnroot
Sudo svnadmin create example
After this command is executed, a directory named example will be added under/home/svnroot, which is the example code repository.

5. Edit the access permission for the example Repository
Modify the three files in/home/svnroot/example/conf: authz passwd svnserve. conf

Where:
Passwd saves the user name and password
The User Group Definition and access permission definitions of various directories are saved in authz.
The configurations used in this code repository are saved in svnserve. conf (Do You Want To allow anonymous users? Specify the user name and password database ...)
Here is a typical configuration:

Passwd instance:

[Users]
Xiaoming = 1111
Xiaowang = 2222
XI Aoli = 3333
Laowang = 4444
Shuangshuffled = 5555
Dashi = 6666

Authz instance (admin can read and write all directories, dev can read and write branch, dev read-only trunk/tag ):

[Aliases]
# Joe =/C = XZ/ST = Dessert/L = Snake City/O = Snake Oil, Ltd./OU = Research Institute/CN = Joe Average
[Groups]
Admin = xiaoli
Dev = laowang, shuangshuang, dashi, xiaowang, xiaoming
[/]
@ Admin = rw
@ Dev = r
[/Trunk]
@ Admin = rw
@ Dev = r
[/Tag]
@ Admin = rw
@ Dev = r
[/Branch]
@ Admin = rw
@ Dev = rw

Svnserve. conf instance (disable anonymous access and specify the user database and Authentication database ):

### This file controls the configuration of the svnserve daemon, if you
### Use it to allow access to this repository. (If you only allow
### Access through http: and/or file: URLs, then this file is
### Irrelevant .)
### Visit http://subversion.tigris.org/for more information.
[General]
### These options control access to the repository for unauthenticated
### And authenticated users. Valid values are "write", "read ",
### And "none". The sample settings below are the defaults.
Anon-access = none
Auth-access = write
### The password-db option controls the location of the password
### Database file. Unless you specify a path starting with /,
### The file's location is relative to the directory containing
### This configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
Password-db = passwd
### The authz-db option controls the location of the authorization
### Rules for path-based access control. Unless you specify a path
### Starting with a/, the file's location is relative to
### Directory containing this file. If you don't specify
### Authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
Authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they shocould
### Have the same password database, and vice versa. The default realm
### Is repository's uuid.
# Realm = My First Repository
[Sasl]
### This option specifies whether you want to use the Cyrus SASL
### Library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve -- version' and look for a line
### Reading 'cyrus SASL authentication is available .'
# Use-sasl = true
### These options specify the desired strength of the security layer
### That you want SASL to provide. 0 means no encryption, 1 means
### Integrity-checking only, values larger than 1 are correlated
### To the cipher key length for encryption (e.g. 128 means 128-bit
### Encryption). The values below are the defaults.
# Min-encryption = 0
# Max-encryption = 256

6. Add the svn service as a system self-starting project

-Create svnd. sh with the following content:

#! /Bin/bash
Svnserve-d-r/home/svnroot
Put this file in/etc/init. d/svnd. sh
Function of this script: To start the svn service, external machines can access the svn server through various svn tools only after the service is started.

-Add executable permissions

Sudo chmod a + x/etc/init. d/svnd. sh

-Edit rc. local

Vim/etc/rc. local

Add/etc/init. d/svnd. sh before exit 0.

-Restart the server and run the following command:

Ps-e | grep svnserve

Check whether the svn service is automatically started with the system from the command results.

Set up SVN server svn in Ubuntu 14.04 ://

CentOS 6.2 SVN setup (YUM installation)

Deploy Apache + SVN in CentOS 6.5

Build an SVN server using Apache + SVN

Set up and use the SVN server in Windows + reset the password on the client

Install SVN in Ubuntu Server 12.04 and migrate Virtual SVN data

Build svn service and migration method on Ubuntu Server

This article permanently updates the link address:

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.