Install SVN in RedHatAS

Source: Internet
Author: User
Install SVN-Linux Enterprise Application-Linux server application in RedHatAS. For more information, see. Subversion (svn) is a version management tool that has emerged in recent years and is the successor of cvs.

Svn servers can run in two ways: independent servers and apache. The two methods have their own advantages and disadvantages.

Svn also stores version data in two ways: BDB and FSFS. Because the BDB method may lock data when the server is interrupted (I am suffering from ldap and cannot cure it), it is safer to use the FSFS method.

1. svn Server Installation

Operating System: Redhat Linux AS4

Obtain the installation package:
Download http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gzand http: // subversion.tigris.org/downloads/subversion-deps-1.4.0.tar.gz.

Compile:
Log on as the root user.
Upload subversion-1.4.0.tar.gzand 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
(Note: Run in svnserve mode without adding apache compilation parameters. Store version libraries in fsfs format without compiling berkeley-db)
Make clean
Make
Make install

Vi/etc/profile, which is added at the end of/etc/profile:
PATH = $ PATH:/opt/svn/bin
Export PATH

Test:
Svnserve? Version

If the following figure is displayed, the installation is successful:
Svnserve, version 1.4.0 (r21228)
Compiled Oct 12 2006, 10:18:56

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product has DES 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
Create a version library directory. You can create multiple directories:
Mkdir-p/opt/svndata/repos1
Mkdir-p/opt/svndata/repos2

Create a version Library:
Svnadmin create/opt/svndata/repos1
Svnadmin create/opt/svndata/repos2

Modify the version library configuration file:
Version Library 1:
Vi/opt/svndata/repos1/conf/svnserve. conf

Modify the content:
[General]
Anon-access = none
Auth-access = write
Password-db =/opt/svn/conf/pwd. conf
Authz-db =/opt/svn/conf/authz. conf
Realm = repos1

Version library 2:
Vi/opt/svndata/repos2/conf/svnserve. conf

Modify the content:
[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 realm = repos2, the other configuration files are exactly the same as those of version 1. If more version libraries are available, follow these steps.

Configure the Users Allowed to access:
Vi/opt/svn/conf/pwd. conf

To simplify the configuration, two version libraries share one user configuration file. If necessary, they can also be separated.

Note: modifications to user configuration files take effect immediately without the need to restart svn.

The file format is as follows:
[Users]
<用户1> = <密码1>
<用户2> = <密码2>

[Users] is required. The following lists the users who want to access svn. each user has a row. Example:
[Users]
Alan = password
King = hello

Configure user access permissions:
Vi/opt/svn/conf/authz. conf

To simplify the configuration, the three version libraries share one permission configuration file/opt/svn/conf/pwd. conf. If necessary, they can also be separated. File.

Note:
* The user name displayed in the permission configuration file must be defined in the user configuration file.
* Changes to the permission configuration file take effect immediately without restarting svn.

User Group format:
[Groups]
<用户组名> = <用户1> , <用户2>
One user group can contain one or more users separated by commas.

Version library directory format:
[ <版本库> :/Project/directory]
@ <用户组名> = <权限>
<用户名> = <权限>

The box number can be written in multiple ways:
/, Indicating the root directory and the following. The root directory is specified when svnserve is started. We specify it as/opt/svndata. In this way,/sets permissions for all version libraries.
Repos1:/, indicating to set permissions for Version 1
Repos2:/occi, indicating to set permissions for the occi project in version library 2
Repos2:/occi/aaa, indicating to set permissions for the aaa directory of the occi project in version library 2

The permission subject can be a user group, user, or *. The user group is preceded by @, * indicating all users. The permission can be w, r, wr, or null. If it is null, no permission is granted.

Example:
[Groups]
Admin = alan

[/]
@ Admin = rw

[Repos1:/occi/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
Create a user to start svn:
Useradd svn
Passwd svn
Set the user svn password as prompted

Allow user svn to access the version Library:
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"

Where:
Su? Svn indicates to start svn as user svn
-D Indicates running in daemon mode (running in the background)
-- Listen-port 9999 indicates that port 9999 is used, which can be replaced with the port you need. Note that the root permission is required to use ports lower than 1024.
-R/opt/svndata specifies that the root directory is/opt/svndata

Check:
Ps? Ef | grep svnserve

If the following information is displayed, the instance is successfully started:
Svn 6941 1 0? 00:00:00 svnserve-d -- listen-port 9999-r/opt/svndata

4. Start svn as a service
In the file/etc/services
Add a row:
Svn 3690/tcp # SVN

Create the file svn in the/etc/xinetd. d/folder. The content is
Service vnc
{
Disable = no
Socket_type = stream
Protocol = tcp
Wait = no
User = root
Server =/usr/local/bin/svnserve
Server_args =-I-r/opt/svndata
}

Run/etc/rc. d/init. d/xinetd restart
Make the above configuration take effect.

Whereis can be used to find the file location.

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.