Revision of Installation from Tue, 06/01/2010 - 14:43

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Configuration and installation of a Subversion server.

Initial Preparation

yum -y install autoconf libtool expat-devel libgssapi-devel python-devel

Download the latest version from the Subversion home page (verison 1.4.6 at time of writing).

cd /extra/src
wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.gz
tar zxvf subversion-1.6.11.tar.gz

Once you have uncompressed the subversion source, proceed to install the prerequisites.

Neon library (http://www.webdav.org/neon/)
The Neon library allows a Subversion client to interact with remote repositories over the Internet via a WebDAV based protocol.

wget http://www.webdav.org/neon/neon-0.29.3.tar.gz
tar zxvf neon-0.29.3.tar.gz
mv neon-0.29.3 subversion-1.6.11/neon

Apache Configuration
Apache can be installed according to these instructions but will need these configuration options, at a minimum:

./configure --enable-dav --enable-so --enable-maintainer-mode

WebDAV instructions are also available for configuring Apache.
Swig
Install Swig:

cd /extra/src
wget http://prdownloads.sourceforge.net/swig/swig-1.3.40.tar.gz
tar zxvf swig-1.3.40.tar.gz
cd swig-1.3.40
./configure
make && make install

Subversion Installation
With the prerequisites installed in the subversion source tree, configure it:

cd /extra/src/subversion-1.6.11
./configure

Edit /extra/src/subversion-1.6.11/Makefile and append -lgssapi to the end of the line that starts:

SVN_APR_LIBS=...

Then build and install the programs:

make
make install

Confirm that /usr/local/apache2/conf/httpd.conf was modified to contain:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
make swig-py
make install-swig-py

Make sure that whatever directory the bindings got installed is in your PYTHONPATH. To do that, check your Python version (python -V) and use either (for CentOS 5 and Python 2.4.x):

echo /usr/local/lib/svn-python > /usr/lib/python2.4/site-packages/subversion.pth

or ( (for CentOS 4 and Python 2.3.x):

echo /usr/local/lib/svn-python > /usr/lib/python2.3/site-packages/subversion.pth

Initial Repository
Create a top-level directory to hold your repositories:

cd /var
mkdir -m 710 svn
chgrp nobody svn

Create your first repository dummy:

cd /var/svn
svnadmin create dummy
chown -R nobody:nobody dummy

Create the Apache user/password file for the svn repositories:

cd /var/svn
/usr/local/apache2/bin/htpasswd -cm .htusers admin
chown root:nobody .htusers
chmod 640 .htusers

To add additional users:

/usr/local/apache2/bin/htpasswd -m .htusers username

Create a text file /var/svn/.authz that defines what the users have access to:

[groups]
admin = admin,username

[/]
@admin = rw
* =

[dummy]
@admin = rw
* = r

Make the file readable by only the Apache user:

chown root:nobody .authz
chmod 640 .authz

Edit /usr/local/apache2/conf/extra/httpd-dav.conf and add a <Location> block for your svn repository:

<Location "/svn">
Dav svn
SVNParentPath /var/svn

AuthzSVNAccessFile /var/svn/.authz
Satisfy Any
Require valid-user

AuthType Basic
AuthName "My subversion repository"
AuthUserFile /var/svn/.htusers
</Location>

Restart Apache:

svc -t /service/apache
svstat /service/apache

Create additional repos
f you wish to create additional repositories (for different clients, different projects, or however you want to keep things organized) you only need to repeat the following steps. Apache itself should not need to be re-configured; the block above will make it treat ALL directories below the /var/svn directory as subversion repositories.

cd /var/svn
svnadmin create name
chown -R nobody:nobody name

If you are creating a new userid for this repository...

/usr/local/apache2/bin/htpasswd -m .htusers username

To set the access rules for this repository, edit /var/www/.authz.

Recent Updates

  • 8 months 3 weeks ago
    1.27.2 update
  • 9 months 4 days ago
    Drupal 10/11 config
  • 9 months 6 days ago
  • PHP
    9 months 6 days ago
    PHP 8.3.11 and AlmaLinux
  • 9 months 6 days ago
    New version of Pound