logo
my pic [home] [shared news] [resume] [bridge] [publications] [software] [about

A mini-howto to setup subversion

(This howto is mainly for Ubuntu but probably also works for other distributions)

A while ago I ran into trouble when I was synchronizing files of several projects between three machines. I was working on two diferent papers and my dissertation and was doing so on three different manchines: @home, @work and on the road on my laptop. I found that good old unison just wasn't good enough anymore. I also wanted versioning and so on. Enter subversion

Setting up the software on my ubuntu box was remarkably simple. All I had to do was install the subversion and libapache2-svn packages as described on the wiki. The second step is to create a repository: svnadmin create /path/to/repos/project. Make sure that these are owned by apache (or, in my case: www-data). Integration with apache turned out to be a little tricky. In my case, the apache config files are in /etc/apache2.

Make sure that apache loads the following modules by creating symlinks in .../mods-enabled/:

The latter has to be modified. Since I wanted both a repository all for myself (give no one access to that one!) and one which others can have access too as well I needed two entries:
  <Location /svn>
    DAV svn
    SVNPath /home/svn/repos
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
    Require valid-user
    Order deny,allow
    Allow from all
    <Limit PROPFIND>
    Allow from all
    </Limit>
  </Location>
  <Location /svnp>
    DAV svn
    SVNPath /home/svn/reposp
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
    AuthzSVNAccessFile /etc/apache2/dav_svn.authz
      Require valid-user
    Order deny,allow
    Allow from all
    <Limit PROPFIND>
    Allow from all
    </Limit>
  </Location>
The first repository (repos) will be the public one and the second one (reposp) will be the private one. Both repositories require a username/password account which can easily be made with htpasswd2 /etc/apache2/dav_svn.passwd user_name.

With that you're all set to go. Check out svn help for more info!