Linux SVN Server Setup

Source: Internet
Author: User

1. Ubuntu pc one, preferably the latest Ubuntu stable version 2. Execute the following command to install Subversion:

sudo apt-get updatesudo apt-get Install Subversion

3. Assuming that the root path of the code SVN repository is/home/svnroot, execute the following command to create a new directory:

sudo mkdir/home/svnroot

4. Create a new code warehouse, assuming the warehouse name is: example

Cd/home/svnrootsudo Svnadmin Create Example

When this command is completed, a directory named example is/home/svnroot under the example code warehouse.

5. Edit access permissions for the example warehouse

That is: Modify the three files under/home/svnroot/example/conf: Authz passwd svnserve.conf

which
User name and password are saved in passwd
The definition of user group and the access rights of each directory are saved in Authz.
The configuration used in this code warehouse is saved in svnserve.conf (Does it allow anonymous users?). Specify user name and password database ... )
Here is a typical configuration:

passwd instances:

[users]xiaoming = 1111xiaowang = 2222xiaoli = 3333laowang = 4444shuangshuang = 5555dashi = 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 = Xiaolidev = 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 (Close anonymous access, specify user database and authentication database):

# # # This file controls the configuration of the Svnserve daemon, if you### with it to allow access to this repository. (If you are 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 is the defaults.anon-access = Noneauth-access = write### The password-db option controls the LO Cation of the password### database file. Unless specify a path starting with a/,### the file's location is relative to the directory containing### this config Uration file.### If SASL is enabled (see below), this file would not be used.### uncomment the line below to use the Defaul T password file.password-db = passwd### The AUTHZ-DB option controls the location of the authorization### rules for Path-b ased access control. Unless you specifyA path### starting with a/, the file's location was relative to the the### directory containing this file. If you don ' t specify an### authz-db, no path-based access control are done.### uncomment the line below to use the default Authorization file.authz-db = authz### This option specifies the authentication realm of the repository.### If the Reposit Ories has the same authentication realm, they should### has 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.### the This section would be ignored if svnserve are not built with cyrus### SASL support; To check, the 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 is correlated### to the effective key length for encryption (e.g. means 128-b it### encryption). The values below is the defaults.# min-encryption = 0# max-encryption = 256

6. Add SVN service as System self-boot project

-Create svnd.sh with the following content

#!/bin/bashsvnserve-d-r/home/svnroot

Put this file in/etc/init.d/svnd.sh
The function of this script: start the SVN service, only after starting the service, the external machine can access the SVN server through various SVN tools.

-Add executable permissions

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

-Edit Rc.local

Vim/etc/rc.local


Before exit 0 , add /etc/init.d/svnd.sh
-Restart the server and execute the command:

Ps-e | grep svnserve
From the command result, check that the SVN service has been automatically booted with the system.



Linux SVN Server Setup

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.