Installation Configuration Server the linux svn

linux installation configuration svn server

 

1. svn server installation

The 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

cd subversion-1.4.0

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

or

[root@server subversion-1.6.6]# find / -name opensslv.h

/usr/include/openssl/opensslv.h

[root@server subversion-1.6.6]# ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db

(Note: Running svnserve way, without apache compiler parameters fsfs format storage repository does not compile berkeley-db.)

make clean

make

make install

 

vi / etc / profile, in / etc / profile and finally add:

 

PATH=/usr/local/svn/bin:$PATH

 

svn test

svnserve -version

If the display is as follows, svn successful installation:

svnserve, version 1.4.0 (r21228)

compiled Oct 12 2006, 10:18:56Copyright (C) 2000-2006 CollabNet.

Subversion is open source software, see http://subversion.tigris.org/

This product includes software developed by CollabNet (http://www.Collab.Net/).

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

* fs_fs : Module for working with a plain file (FSFS) repository.

2. svn configuration

[Root @ server ~] # mkdir -p / home / svndata / dsm # establishment of the repository

[root@server ~]# /usr/local/svn/bin/svnadmin create /home/svndata/ dsm

Modify svn repository configuration file

Repository 1:

vi / home /svndata/dsm/conf/svnserve.conf

Is amended as follows:

[general]

anon-access = none

auth-access = write

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

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

realm = dsm

In addition realm = repos2 i.e., the other with a profile identical to the repository. If there were more repository, and so on.

Configuration allows users to access svn

we /usr/local/svn/conf/pwd.conf

To simplify the configuration, two versions of a shared library user profiles. If necessary, it can also be separated.

Note: The modifications to the user profile to take effect immediately, without restarting svn.

File format is as follows:

[users]

<User 1> = <password 1>

<User 2> = <2 password>

Wherein, [users] is necessary. To access the list below svn users, each user line. Example:

[users]

alan = password

king = hello

Svn configure user access rights

we /opt/svn/conf/authz.conf

To simplify the configuration, three sharing a rights repository profiles /opt/svn/conf/pwd.conf. If necessary, it can also be separated. Define user groups and file repository directory permissions.

note:

* User rights profile name appears to be defined in the user profile.

* Changes to the rights profile take effect immediately, without restarting svn.

User group format:

[groups]

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

Wherein a user group can contain one or more users, between users separated by commas.

Repository directory format:

[<Repository>: / project / directory]

@ <User group name> = <permission>

<User name> = <permission>

Wherein the inner portion can have a variety of writing block numbers:

/ Represents the root directory and below. The root directory is specified when svnserve start, we designated as / opt / svndata. In this way, / that represents all set permissions for the repository.

dsm: /, represents 1 set repository permissions

repos2: / abc,, expressed in the project repository 2 abc set permissions

repos2: / abc / aaa,, it represents the aaa directory set permissions on the repository 2 abc project

Rights body can be a user group, or * users, user groups, preceded by @, * represents all users. Permissions can w, r, wr and empty, empty means no rights.

Example:

[groups]

= admin area

[/]

@admin = rw

[dsm:/abc/aaa]

king = rw

[repos2:/pass]

king =

[/]

dongzhukai = rw

[/root]

@document_user = r

[/root/document]

@document_user = rw

[/root/code]

dongzhukai = rw

@document_user = rw

svn configured, delete unwanted files

rm /opt/svndata/dsm/conf/authz

rm /opt/svndata/dsm/conf/passwd

rm /opt/svndata/repos2/conf/authz

rm /opt/svndata/repos2/conf/passwd

3. Start svn

The establishment of a user-initiated svn

useradd svn

passwd svn

Follow the prompts to set a password for the user svn

It allows users to access the svn repository

chown -R svn:svn /home/svndata

Start svn

su - svn -c “svnserve -d –listen-port 9999 -r / home /svndata”

among them:

su - svn svn expressed in the user's identity to start svn

-d representation (background) run as a daemon

-listen-port 9999 represents the use of port 9999, you can be replaced with the ports you need. But note that a port below 1024 requires root privileges

-r / opt / svndata specify the root directory is / opt / svndata

an examination:

ps -ef | grep svnserve

If shown below, is the successful start:

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

 

4, SVN Client Access Address:

 

svn://192.168.1.87:9999/repos

 

Guess you like

Origin www.cnblogs.com/aliswell2king/p/11757431.html