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]http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz[/url] and [url]http://subversion.tigris.org/ Downloads/subversion-deps-1.4.0.tar.gz[/url].

Compile:

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

./configure–prefix=/opt/svn–without-berkeley-db–with-zlib

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

Make clean

Make

Make install

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

Path= $PATH:/opt/svn/bin

Export PATH

Test:

Svnserve–version

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]http://subversion.tigris.org/[/url]

This product includes software developed by CollabNet ([Url]http://www.collab.net/[/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:

Mkdir-p/OPT/SVNDATA/REPOS1

Mkdir-p/opt/svndata/repos2

To build a repository:

Svnadmin CREATE/OPT/SVNDATA/REPOS1

Svnadmin Create/opt/svndata/repos2

To modify the repository configuration file:

Build Library 1:

Vi/opt/svndata/repos1/conf/svnserve.conf

Content modified to:

[General]

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:

Vi/opt/svndata/repos2/conf/svnserve.conf

Content modified to:

[General]

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:

Vi/opt/svn/conf/pwd.conf

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:

[Users]

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

[Users]

Alan = password

King = Hello

To configure user access rights:

Vi/opt/svn/conf/authz.conf

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.

Attention:

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

[Groups]?

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

Example:

[Groups]

admin = Alan

[/]

@admin = RW

[REPOS1:/ABC/AAA]

King = RW

[Repos2:/pass]

King =

Delete useless files:

Rm/opt/svndata/repos1/conf/authz

rm/opt/svndata/repos1/conf/passwd

Rm/opt/svndata/repos2/conf/authz

rm/opt/svndata/repos2/conf/passwd

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"

which

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

Check:

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

Characteristics

Berkeley DB

FSFS

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

No

OK

Storage Platform agnostic

No

OK

Accessible from the network file system

No

OK

Version Library size

Slightly larger

Slightly smaller

Extensibility: Number of revision trees

Unlimited

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

OK

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

2001

2004

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

: [url]http://apr.apache.org/[/URL]

Tar zxvf apr-1.2.7.tar.gz?

./configure

Make

Make install

Tar zxvf apr-util-1.2.7.tar.gz

./configure--with-apr=/usr/local/apr/

Make

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

Make install

3, Installation subversion-1.4.0

Tar zxvf subversion-1.4.0.tar.gz

./configure--with-apxs=/opt/apache/bin/apxs--WITH-APR=/USR/LOCAL/APR--WITH-APR-UTIL=/USR/LOCAL/APR

Issue: About shared library errors

Method: Echo "/usr/local/apr-util/lib" >>/etc/ld.so.c

Ldconfig echo $?

Make

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
?

Vi/opt/apache/conf/httpd.conf

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

LoadModule Dav_svn_module modules/mod_dav_svn.so

LoadModule Authz_svn_module modules/mod_authz_svn.so

5. Configure SVN

Vi/opt/apache/conf/httpd.conf

Configuration:

DAV SVN

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

AuthType Basic//connection type settings

AuthName "Subversion Repository"//Connection Box tips

AUTHUSERFILE/DATA/SVN/PASSWD//user profile

Authzsvnaccessfile/data/svn/auth

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

?

6. Build SVN storage Warehouse

#mkdir-P/opt/svndata/repos

#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

Touch/opt/svndata/auth

The contents of the file are:

[Groups]

[repos1:/]

#wxy = RW

North = RW

Tom = RW

[repos2:/]?

Repos2 = RW

9, install the client, access the server

[Url]http://192.168.0.180:/svn/jishu[/url]

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://192.168.0.180:20000/opt/svndata/mark/bo-m "Delete"

Export

$svnlook Youngest Oldrepo

$svnadmin Dump Oldrepo >; DumpFile

Restores

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