Install the Linux SVN Service

Source: Internet
Author: User
Tags collabnet

Subversion independent service and integrated service with Apache.
I. SVN Independent Service Installation
Operating System: RedHat Linux as3 as 4 contos as 4
Obtain the installation package:
Download http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz
And http://subversion.tigris.org/dow... n-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
The subversion-deps package has four directories: zlib APR Apr-util neon. All these four directories are dependent packages. The Code required for compiling Subversion
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]
=
=
[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]
=,
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:/ABC, indicating to set permissions for the ABC Project in version library 2
Repos2:/ABC/AAA, indicating to set permissions for the AAA directory of the ABC 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:/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
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 port 9999, which can be replaced with the required port. 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
Ii. Integration of SVN and Apache
The Subversion storage method is the Berkeley dB Berkeley storage method, and the fsfs storage method.
Data storage table of two versions
Features: Berkeley dB fsfs
Sensitive to operation interruptions; system crashes or permission issues can cause database congestion and regular recovery is required. Insensitive
Read-Only loading is not allowed
Storage platform independence cannot
Accessible from the Network File System
Version library is slightly larger and smaller
Scalability: the number of revision trees is unlimited. Some local file systems may encounter problems when processing a single directory containing thousands of entries.
Scalability: directories with many files are slow.
It is faster to check out the latest code.
A large number of submissions are slow, but the time is allocated to the entire submission operation, but the last long delay may cause the client operation to time out.
The Group access permission processing is very sensitive to the user's umask settings. It is recommended that only one user access the group. Insensitive to umask settings
Function Maturity Date: January 1
1. Install APR-1.2.7 and APR-util-1.2.7
: Http://apr.apache.org/

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. Install 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
Problem: Shared Library Error
Method: Echo "/usr/local/APR-util/lib">/etc/lD. So. c
Ldconfig echo $?
Make
Make install
Set environment variables (do not do it)
VI/etc/profile, which is added at the end of/etc/profile:
Path = $ path:/opt/SVN/bin
Export path
4. Check whether the two dynamic libraries of subversion are successfully installed.
VI/opt/Apache/CONF/httpd. conf
The following two modules indicate that the installation is successful.
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 // set the connection type
Authname "Subversion repository" // connection box prompt
Authuserfile/data/SVN/passwd // user configuration file
Authzsvnaccessfile/data/SVN/auth
Require valid-user // All passwd users can access
6. Create a SVN storage warehouse
# Mkdir-P/opt/svndata/Repos
# Svnadmin create-FS-type fsfs/opt/svndata/Repos
Back up previous SVN Databases
# Svnadmin dump/opt/svndata/repos>/root/repos20080328
Recover the backup data to the local device.
# Svnadmin load/opt/svndata/repos/; dumpfile
// Restore
$ Svnadmin load newrepo

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.