A Simple Subversion Server

Mar 01, 2007

In my move to Slicehost one of things that I was high on my to-do list was to move subversion repositories over and get everything back up and running so I could continue coding. Rather than go through the hassle of getting everything served over http through Apache I decided to investigate svnserve, the nice little server that is provided with subversion itself.

The Path of Least Resistance

I guess the easiest thing to do would just keep my repositories on my laptop and just keep it all local, but the nice thing about keeping things on my hosting server is that it’s more reliable and it’s a necessary part of using Capistrano for Rails deployment.

While a very robust way to make your subversion repositories available over the web is through http (and SSL), most of the tutorials I found online require a lot of steps and a lot of different parts. Rather than have to worry about configuring Apache I decided to just use svnserve since I’m probably the only one who is ever going regularly accessing the repositories.

Setting up svnserve

The Subversion Book has a nice tutorial on setting up svnserve, I’d highly recommend reading it if you want to go this route.

Here’s a brief summary of what needs to be done.

1. Configure Your Repository

In your repository should be a conf/svnserve.conf file. All you really need to do is enable auth-access = write and set your realm (I’d suggest just always using your primary domain url). And instead of using the local passwd file I’d suggest just setting up a single passwd file for all your repositories. Then just reference it in each svnserve.conf. Also make sure you set your user name the same as your server login to make authentication easy.

2. Start svnserve

Now just start svnserve like this:

svnserve -d -r /path/to/your/repositories/

That’s really there all there is to it. Now from your client you can just type:

svn co svn://yourdomain.tld/project .

I find this an extremely easy way to set up a web based subversion server and it’s easy to maintain and administer.