SVN service configuration and routine maintenance commands

Source: Internet
Author: User
Tags root access collabnet

Subversion standalone service and integration with Apache services.

One, SVN standalone service installation

Operating system: Redhat Linux AS3 as 4 Contos as 4

The installation package gets:

Download [Url][/url] and [url] Downloads/subversion-deps-1.4.0.tar.gz[/url].


Log in as the root user.

Upload subversion-1.4.0.tar.gz and subversion-deps-1.4.0.tar.gz to the server.

Tar xfvz subversion-1.4.0.tar.gz

Tar xfvz subversion-deps-1.4.0.tar.gz

The Subversion-deps package has four directories zlib Apr apr-util Neon These four directories are all dependent packages and the code necessary to compile subversion

CD subversion-1.4.0


(Note: Run in Svnserve mode without Apache compilation parameters.) Store the repository in FSFS format, without compiling berkeley-db)

Make clean


Make install

Vi/etc/profile, in/etc/profile last added:

Path= $PATH:/opt/svn/bin

Export PATH



If it appears as follows, the installation succeeds:

Svnserve, Version 1.4.0 (r21228)

Compiled OCT 12 2006, 10:18:56

Copyright (C) 2000-2006 CollabNet.

Subversion is open source software, see [Url][/url]

This product includes software developed by CollabNet ([Url][/url]).

The following repository back-end (FS) modules is available:

* Fs_fs:module for working with a plain file (FSFS) repository.

2. SVN configuration

To build a repository directory, you can build multiple:



To build a repository:


Svnadmin Create/opt/svndata/repos2

To modify the repository configuration file:

Build Library 1:


Content modified to:


Anon-access = None

auth-access = Write

Password-db =/opt/svn/conf/pwd.conf

Authz-db =/opt/svn/conf/authz.conf

Realm = Repos1

Build Library 2:


Content modified to:


Anon-access = None

auth-access = Write

Password-db =/opt/svn/conf/pwd.conf

Authz-db =/opt/svn/conf/authz.conf

Realm = Repos2

That is, except for realm = Repos2, the other is identical to the version library 1 configuration file. If there are more repositories, and so on.

To configure which users are allowed to access:


To simplify configuration, 2 repositories share 1 user profiles. If necessary, you can also separate.

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

The file format is as follows:


< user 1> = < password 1>

< user 2> = < password 2>

Among them, [users] is required. The following lists the users to access SVN, one row per user. Example:


Alan = password

King = Hello

To configure user access rights:


To simplify configuration, 3 repositories share 1 rights profile/opt/svn/conf/pwd.conf. If necessary, you can also separate. The user group and repository directory permissions are defined in the file.


* The user name that appears in the permissions profile must already be defined in the user profile.

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

User group format:


< user group name > = < user 1>,< user 2>

Of these, 1 user groups can contain 1 or more users, separated by commas between users.

Repository directory format:

[< Repository >:/project/catalog]

@< user Group Name > = < permissions >

< user name > = < permissions >

Where the box number can be written in several ways:

/, which indicates the root directory and the following. The root directory is specified at svnserve startup and we specify/opt/svndata. This means that the permissions are set for all repositories.

repos1:/, which indicates that permissions are set on version library 1

REPOS2:/ABC, which indicates that permissions are set on the ABC project in version Library 2

REPOS2:/ABC/AAA, which represents the AAA directory setting permissions on the ABC project in version 2

A permission principal can be a user group, user, or *, and the user group is preceded by @,* to represent all users. Permissions can be W, R, WR, and NULL, and NULL indicates no permissions.



admin = Alan


@admin = RW


King = RW


King =

Delete useless files:





3. Start SVN

To create a user to start SVN:

Useradd SVN

passwd SVN

Follow the prompts to set a password for the user svn

Allow user svn access to repository:
? chown-r Svn:svn/opt/svndata

Chown-r Svn:svn/opt/data?

Start SVN:

Su-svn-c "Svnserve-d–listen-port 9999-r/opt/svndata"


SU-SVN means to start svn as user svn

-d means running in daemon (background run)

–listen-port 9999 means using 9999 ports, which you can replace with the ports you need. Note, however, that using a port under 1024 requires root access

-r/opt/svndata specifies that the root directory is/opt/svndata


Ps-ef|grep Svnserve

If shown below, this is the start success:

SVN 6941 1 0 15:07? 00:00:00 Svnserve-d–listen-port 9999-r/opt/svndata

Second, SVN services and Apache integration

Subversion storage, one is Berkeley DB Berkeley storage, and the second is the FSFS storage mode.

Two versions of Repository data storage table


Berkeley DB


Sensitivity to operational interruptions

System crashes or permissions issues can cause the database to "jam" and require regular recovery.

Not sensitive

Can read-only load



Storage Platform agnostic



Accessible from the network file system



Version Library size

Slightly larger

Slightly smaller

Extensibility: Number of revision trees


Some local file systems have problems processing a single directory that contains thousands of entries.

Extensibility: Directories with large files

More slowly

More slowly

The speed of checking out the latest code

More quickly


The speed of a lot of commits

Slower, but the time is allocated throughout the commit operation

Faster, but the last longer delay may cause client operations to time out

Group access rights processing

is sensitive to the user's umask settings and is best accessed by only one user.

Insensitive to Umask settings

Function Maturity Time



1. Installation of APR-1.2.7 and apr-util-1.2.7

: [url][/URL]

Tar zxvf apr-1.2.7.tar.gz?



Make install

Tar zxvf apr-util-1.2.7.tar.gz



Make install

2. Compile and install Apache.

Tar zxvf httpd-2.2.3.tar.gz

CD httpd-2.2.3

./configure--prefix=/opt/apache--enable-dav--enable-so--enable-maintainer-mode--with-apr=/usr/local/apr/bin/ Apr-1-config--with-apr-util=/usr/local/apr/bin/apu-1-config


Make install

3, Installation subversion-1.4.0

Tar zxvf subversion-1.4.0.tar.gz


Issue: About shared library errors

Method: Echo "/usr/local/apr-util/lib" >>/etc/

Ldconfig echo $?


Make install

Set environment variables (can do not do)

Vi/etc/profile, in/etc/profile last added:

Path= $PATH:/opt/svn/bin

Export PATH

4. See subversion Two dynamic libraries have been installed successfully


See the following two modules to illustrate the success of the installation?

LoadModule Dav_svn_module modules/

LoadModule Authz_svn_module modules/

5. Configure SVN




Svnparentpath/data/svn/repos//SVN Parent Directory

AuthType Basic//connection type settings

AuthName "Subversion Repository"//Connection Box tips



Require Valid-user//passwd All users have access to the


6. Build SVN storage Warehouse


#svnadmin Create–fs-type Fsfs/opt/svndata/repos

Back up the previous SVN library

#svnadmin Dump/opt/svndata/repos >/root/repos20080328

Restore the backed-up data to a local

#svnadmin load/opt/svndata/repos/</root/repos20080328

7. Establish local access control files

#/opt/apache/bin/htpasswd [-c]/opt/passwd north

The first time you set up a user, use-c indicates a new user file. #/opt/apache/bin/htpasswd passwd User name (join new user)

8. Establish local project control files


The contents of the file are:



#wxy = RW

North = RW

Tom = RW


Repos2 = RW

9, install the client, access the server


Note: SVN is added to the Apache configuration.

10, to the basic end of this installation

Modify the/data/svn/repos property, which will cause the file upload to fail.

Chmod-r Apache.apache Repos

Iii. routine maintenance commands and parameters

Start SVN service

svnserve-d--listen-port 20000-r/opt/svndata

To create a version library

Svnadmin Create Fs-type Fsfs/opt/svndata/mark

View the Repository information

SVN list File:///opt/svndata/mark

SVN list--verbose File:///opt/svndata/mark

directory structure of the import library

SVN import/tmp/mark/file:///opt/svndata/mark/--message "Init" (folder Mark has Bo)

Delete Repository mark under folder Bo

SVN delete svn:// "Delete"


$svnlook Youngest Oldrepo

$svnadmin Dump Oldrepo >; DumpFile


$svnadmin Load Newrepo < DumpFile

Stop Subversion Service

Ps–aux | grep svnserve

Kill-9 ID Number

SVN service configuration and routine maintenance commands

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: 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.