Using Subversion with Apache Virtual Hosts

I’ve been using Subversion for a while through SSH. Whilst upgrading my home server to Fedora Core 2 I decided to try implementing it through Apache WebDAV.

This is already well documented, but I wanted to be awkward – I wanted to host my repository behind a virtual host, and documentation for this is lacking so…

Simply add the following to your httpd.conf – I’m assuming you already know how to set up virtual hosts.

 <VirtualHost *:80>
     DocumentRoot /path/to/subversion/repositories
     ServerName svn.example.com
     ServerAlias svn

     <Location />
         DAV svn
         SVNParentPath /path/to/subversion/repositories
     </Location>
 </VirtualHost>

This configuration will allow you to host multiple repositories located in /path/to/subversion/repositories under the virtual host svn.example.com – now you just need to figure out your permissions!

I thoroughly recommend the book “Version Control with Subversion” which is available in both dead tree and online formats.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

One Response to “Using Subversion with Apache Virtual Hosts”

  1. Anonymous Coward says:

    I fail to recognize why the
    ServerAlias svn
    line is necessary