Tag Archives: Subversion

Subversion Installation with Submin, WebDAV, & WebSVN

Installation of Subversion with:

  • Submin for administering subversion users and repositories
  • WebDAV for access to repositories
  • WebSVN for browser access to repositories

Subversion Installation:

aptitude install subversion

Submin Installation:

Add the following repository to /etc/apt/sources.list:

# Submin Repository
deb http://debian.supermind.nl/ current main

Install key for submin repository:

wget -q -O - http://supermind.nl/debian.key | apt-key add -

Update Package List and Install Submin:

aptitude update
aptitude install submin

Create Folder Structure and Files:

mkdir /var/svn
mkdir /var/svn/conf
mkdir /var/svn/repos
touch /var/svn/conf/authz
touch /var/svn/conf/htpasswd
touch /var/svn/conf/submin.conf
touch /var/svn/conf/userproperties.conf
touch /var/svn/conf/apache-svn.alias

Add Submin Admin User

htpasswd -m /var/svn/conf/htpasswd administrator

Configuration File Contents:

# /var/svn/conf/authz
[groups]
submin-admins = administrator
#/var/svn/conf/submin.conf
[svn]
authz_file = /var/svn/conf/authz
userprop_file = /var/svn/conf/userproperties.conf
access_file = /var/svn/conf/htpasswd
repositories = /var/svn/repos

[www]
base_url = /submin
svn_base_url = /svn
trac_base_url =

[backend]
bindir = /usr/share/submin/bin

[generated]
session_salt = d7xOuU8hY9cF1qB/u/
# /var/svn/conf/apache-svn.conf
# Default Apache Submin Configuration

Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
 Options ExecCGI FollowSymLinks
 AddHandler cgi-script py cgi pl
 SetEnv SUBMIN_CONF /var/svn/conf/submin.conf  

 RewriteEngine on
 RewriteBase /submin                           

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ submin.cgi/$1              

 RewriteRule ^/?$ submin.cgi/                  

 Order Allow,Deny
 Allow from all
</Directory>                                   

# WebDAV Configuration
<Location /svn>
 DAV svn
 SVNParentPath /var/svn/repos
 AuthzSVNAccessFile /var/svn/conf/authz        

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/svn/conf/htpasswd
 Require valid-user                            

 Order Allow,Deny
 Allow from all
 Satisfy Any
</Location>                                    

# WebSVN Configuration
Alias /websvn "/var/svn/websvn/"
<Directory "/var/svn/websvn/">
 Options -Indexes -FollowSymLinks
 AllowOverride None                            

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/svn/conf/htpasswd
 Require valid-user                            

 Order Allow,Deny
 Allow from all
 Satisfy All
</Directory>

# Disallow web access to directories that don't need it
<Directory "/var/svn/websvn/include">
 Order Deny,Allow
 Deny from All
</Directory>

WebSVN Installation

  • Download WebSVN from http://www.websvn.info/download/.
  • Extract the contents of the archive to /var/svn/ and rename the folder from 'websvn-?.?.?' to just 'websvn‘.
cd /var/svn
wget http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz
tar -xvzf websvn-2.3.1.tar.gz
mv websvn-2.3.1 websvn
  • Configure WebSVN with the following file:
<?php
// # /var/svn/websvn/include/config.php

$config->setSvnConfigDir('/etc/subversion');
$config->parentPath('/var/svn/repos');
$config->addTemplatePath($locwebsvnreal.'/templates/calm/');
$config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/');
$config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');
$config->useAuthenticationFile('/var/svn/conf/authz'); // Global access file
$config->addInlineMimeType('text/plain');
$config->setMinDownloadLevel(2);
$config->useGeshi();
set_time_limit(0);
$config->expandTabsBy(8);

Configure Permissions:

chown -R root:www-data /var/svn
chmod -R ug=rwX,o= /var/svn/conf
chmod g-w /var/svn/conf/apache-svn.conf
chmod -R ug=rwX,o= /var/svn/repos
chmod -R 750 /var/svn/websvn

Configure Apache:

  • Enable Apache Mod Rewrite
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
  • Include the required apache configuration by adding a symlink to the apache conf.d directory
ln -s /var/svn/conf/apache-svn.conf /etc/apache2/conf.d/apache-svn.conf
  • Restart Apache Server
/etc/init.d/apache2 restart

SVN on Ubuntu

Repository Location: /var/lib/submin/svn

/etc/apache2/sites-available/fender-svn.alias

# /submin and /svn from /etc/submin/default-apache-cgi.conf

Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
 Options ExecCGI FollowSymLinks
 AddHandler cgi-script py cgi pl
 SetEnv SUBMIN_CONF /etc/submin/default.conf

 RewriteEngine on
 RewriteBase /submin

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ submin.cgi/$1

 RewriteRule ^/?$ submin.cgi/

 Order Allow,Deny
 Allow from all
</Directory>
<Location /svn>
 DAV svn
 SVNParentPath /var/lib/submin/svn
 AuthzSVNAccessFile /var/lib/submin/authz

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/lib/submin/htpasswd
 Require valid-user

 Order Allow,Deny
 Allow from all
 Satisfy Any
</Location>

Alias /websvn "/var/www/websvn/"
<Directory "/var/www/websvn/">
 Options -Indexes -FollowSymLinks
 AllowOverride None

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/lib/submin/htpasswd
 Require valid-user

 Order Allow,Deny
 Allow from all
 Satisfy All
</Directory>