Setting up subversion on Debian etch

Yesterday I installed subversion on a Debian server again and I had too look for some guidance in the web again. This time I decided to write it down for myself.

I installed the following packages with aptitude:

sudo aptitude install libapache2-svn subversion subversion-tools

Afterwards the needed modules were already enabled in my apache2 configuration - I looked in /etc/apache2/mods-enabled/ and saw dav.load, dav_svn.conf and dav_svn.load linked. All I had to do was to create a repository by using svnadmin:

sudo svnadmin create /var/lib/svn/main

and configure the access path in my apache2 configuration:

<Location /svn>
    DAV svn
    SVNListParentPath on
    SVNParentPath /var/lib/svn
    AuthType Basic
    AuthName "Subversion repositories"
    AuthUserFile /var/www/.svnusers
    Require valid-user
</Location>

I created some users with htpasswd and wrote them to the configured file /var/www/.svnusers. After loading the apache2 configuration I was able to connect and use the repository. I made www-data (the user under which apache2 runs) the owner of the repository and its files.

If you want more detailed configuration of access permissions have a look at the AuthzSVNAccessFile configuration directive.