How to setup an SVN Repository on Apache (http) on Ubuntu

Posted on Sunday August 14, 2011 / by Eric Potvin

Here's how to setup quickly your SVN repository with your Apache using DAV.

** Requirement: **

In order to setup the svn repository, you need the to have apache and svn installed. for more info, view the following articles:


First step, install the lib for apache:

sudo aptitude install libapache2-svn

Now, let's modify the apache svn module config file:

sudo vi /etc/apache2/mods-available/dav_svn.conf

and edit the file using the following configuration:

<Location /svn>
    DAV svn

    SVNParentPath /var/svn/repository
    #SVNPath /var/svn/repository

    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
    Require valid-user
</Location>

In order to be able to see who modify what, simply create your user using the following command:

sudo htpasswd -c /etc/apache2/dav_svn.passwd <user>

Restart Apache, just in case:

sudo /etc/init.d/apache2 restart

Done!

Now you should be able to view your projects using Firefox or Chrome using the following address.

http://<ip-of-my-computer>/svn/<my-project>/