Thursday, August 30, 2007

Subversion Howto - WebDav and SVNServe

It's been a couple of days since I've setup Subversion in my box. I'm posting this for future reference... I'll be reinstalling Kubuntu when the Next Alpha version comes out, and No... I'm not talking about Gutsy, I'm already using it. Most of the instructions here came from the Subversion article of the Ubuntu Documentation.

Preparation

  • Add svn group
  • Add my username and www-data as users of the group

  • sudo mkdir /var/svn
  • cd /var
  • sudo chown -R www-data svn
  • sudo chgrp -R svn svn
  • sudo chmod -R g+rws svn
  • sudo svnadmin create /var/svn
WebDAV Configuration
I need this so I can access my Subversion using the http:// protocol
  • Install libapache2-svn
  • Append the following into /etc/apache2/mods-available/dav_svn.conf
<Location /svn> DAV svn SVNPath /var/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/subversion/passwd <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>

  • Restart Apache2: sudo /etc/init.d/apache2 restart
  • Add user: sudo htpasswd -c /etc/subversion/passwd username
SVN Configuration
svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = Subversion Repository

passwd
[users]
user = password

authz
[/]
user =rw
* = r

/etc/init.d/svn
#!/bin/bash
svnserve -d -r /var/svn

Done!
So there it is, I've been accessing my Subversion by using both http and svn protocols. But I just might drop WebDAV access on my next reinstall. Frankly, it's redundant.

Blogged with Flock