User Tools

Site Tools


scm:svn:installation

Setting up Subversion & WebSVN

See also Apache setup section in the Red Bean Book.

Install all dependencies

yum install -y subversion mod_dav_svn

rpm packages

If you want to install the newest subversion releases you can directly install the rpm packages.

  • Packages for Red Hat can be found at the following at the.earth.li.

Alternative installs

Consider installing the CollabNet SVN packages for RedHat to have a out of the box experience.

Create repositories

To create a new repository http://localhost/repos/stuff using this configuration, run as root:

cd /srv/svn/
mkdir repos
cd repos
svnadmin create stuff
chown -R apache.apache stuff

Configure Apache, SSL, WebSVN and Path-Based Security

Example apache Virtual Host configuration with self signed certificate:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
 
<VirtualHost *:443>
    ServerName example.com
    DocumentRoot /srv/svn/htdocs
    CustomLog logs/subversion-access_log combined
    ErrorLog logs/subversion-error_log
 
    php_admin_value display_errors On
 
    SSLEngine On
    SSLProtocol all -SSLv2
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
 
    <Directory /srv/svn/htdocs>
        DirectoryIndex wsvn.php
        Options MultiViews
 
        AuthType Basic
        AuthName "websvn repository overview"
        AuthUserFile /srv/svn/htpasswd
        Require valid-user
        SSLRequireSSL
    </Directory>
 
    <Location /repos/>
        DAV svn
        SVNParentPath /srv/svn/repos
 
        AuthzSVNAccessFile /srv/svn/authz
        AuthType Basic
        AuthName "Subversion Repositories"
        AuthUserFile /srv/svn/htpasswd
        AuthUserFile /srv/svn/htpasswd
        Require valid-user
        SSLRequireSSL
    </Location>
</VirtualHost>

websvn

Find more information about websvn on the project homepage

Installation

Download the WebSVN PHP application from http://websvn.tigris.org/ and save it in the web folder configured above.

  • Copy the the template config
    cp include/distconfig.php include/config.php
  • Example websvn.config (in /websvn/include/config.php)
// {{{ PLATFORM CONFIGURATION ---
// For syntax colouring, if option enabled...
$config->setEnscriptPath('/usr/bin/');
$config->setSedPath('/bin/');
// For delivered tarballs, if option enabled...
$config->setTarPath('/bin/');
// For delivered GZIP'd files and tarballs, if option enabled...
$config->setGZipPath('/bin/');
// {{{ REPOSITORY SETUP ---
$config->parentPath('/srv/svn/repos/');
// {{{ MULTIVIEWS ---
$config->useMultiViews();
// {{{ ACCESS RIGHTS ---
$config->useAuthenticationFile('/srv/svn/authz'); // Global access file
// {{{ TARBALLS ---
$config->allowDownload();
$config->setMinDownloadLevel(1);
// {{{ COLOURISATION ---
$config->useGeshi();

Create authorization files

htaccess

create users in the apache basic auth file:

cd /srv/svn/
htpasswd -cm htpasswd user1
Password:
Repeat Password:

Create a svn path based access file:

vim authz

Example file:

[groups]
admin = niwo
 
[/]
@admin = r
niwo = rw
 
[iccis:/]
niwo = rw
 
[example.com:/]
deepblue = rw
 
[admin.example.com:/]
deepblue = rw
 
[api.example.com:/]
deepblue = rw
/srv/wiki.niwos.com/data/pages/scm/svn/installation.txt · Last modified: 2009/08/15 12:14 (external edit)