Linux Svn Server Installation

Source: Internet
Author: User
Tags collabnet

Operating System: Redhat Linux AS 4
Obtain the installation package:
Download
Http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz
And http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz
Compile:
Log on as the root user.
Upload subversion-1.6.6.tar.gzand subversion-deps-1.6.6.tar.gz to the server.
Tar xfvz subversion-1.6.6.tar.gz
Tar xfvz subversion-deps-1.6.6.tar.gz
The subversion-deps package has four directories: zlib apr-util neon. All these four directories are dependent packages. The Code required for compiling subversion
Cd subversion-1.6.6
./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.2 (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 3690-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 3690 indicates port 3690, 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 3690-r/opt/svndata

Notes:
1. The server has started svn, but the client cannot access it.
The problem may be caused by the linux firewall. Check the iptables configuration and open the svn server port.


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


This article is from the open-source Chinese community author roockee

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.