14. Installing subversion

Introduction

You may not be a programmer. You may not be a website designer. You may think you don't need subversion at all. Yet, you may not know Subversion at all and therefore you may think that it is another version of Much Ado About Nothing, originally by Shakespear, wasn't it? Well, you're wrong.

I'm pretty sure you have some documents that you modify once in a while, but not always on the same location. An address book anywhere? Hm... Or a list of CDs? Or a Calendar? Etc... there are plenty of applications to be found for a version control system and it all boils down to one thing: if you need to modify a document with various persons or from various locations, a Versioning System is bloody easy to have around.

So, I admit that the main reason this chapter is included is because it is my main concern to have it working on my personal server. I manage my websites with this tool, I manage my source code with this tool, I manage the list of birthdays of my friends with this and the list of CDs. Yep, let's just say Subversion will make you a better person. Or a better computer user at least!

And it's bloody easy to configure & install...

Installing and Configuring Subversion

Subversion needs Apache2. Nice thing of the package system is that when you install subversion it will automatically detect that it depends on Apache2 and will install it for you as well. In theory that is. In practice the package maintainers have chosen to not depend upon Apache2, and you need to install it seperately.

Allright, allright... something can be said for this approach. You don't need to have it running over apache, and it would make the installation process for those that don't need an apache 2 server ridiculously clumsy. So, let's just go for it.

What we need to do is install this list of packages:

  • sudo apt-get install subversion
  • sudo apt-get install apache2
  • sudo apt-get install libapache2-svn

Ok, that's it for installing what we need. We need some configuration settings however. This can't be done with webmin, so you will need to do some manual hacking with nedit on your knoppixbox. Somehow, Webmin has not updated to Apache2 yet. It's not the only one, PHP4 on Debian Apache2 is also still a bit of a pain. Somehow, people don't seem to see any advantage of Apache2 over Apache, so they stick with what works. Perfectly viable of course.

Luckily we can run both Apache2 and normal Apache servers side by side and we can later change the port of this Subversion server to something different if we want to install a regular Apache with PHP enabled on our knoppixbox.

Now that subversion is installed we need to create a repository. It's pretty easy. It involves choosing a path to store the repository in. I would suggest something like /home/subversion/. Issuing the command svnadmin create /home/subversion/ will do the trick, if we also make sure the apache2 daemon has access:

Code listing 14.1

kristof@knopppixbox:~/ sudo svnadmin create /home/subversion/
kristof@knopppixbox:~/ sudo chown -R www-data.www-data /home/subversion/

To make the repository accessible via the Apache2 web server, we need to enable the module by creating a link in the mods-enabled section of the configuration, change the configuration settings a bit and restart the web server.

So, let's start with this:

Code listing 14.2

kristof@knoppixbox:~/ sudo cp /etc/apache2/mods-available/dav_svn.conf /etc/apache2/mods-enabled/dav_svn.conf
kristof@knoppixbox:~/ sudo nedit /etc/apache2/mods-enabled/dav_svn.conf
Now, we need to uncomment the lines that say # DAV svn to DAV svn, and the line saying # SVNPath /var/lib/svn to SVNPath /home/subversion. Now, restarting apache2, with the command /etc/init.d/apache2 restart is all we need to get going!

Note:
todo:
... explain the client side

Firewall Configuration

As always, the firewall needs to be set so that it will allow

Action Source Destination Protocol Source ports Destination ports Comment
Accept Zone Local Firewall TCP Any 80 Allow the local network to connect to the Apache2 server, and thus to Subversion.

line
Updated $LastChangedDate: 2004-11-05 23:24:59 +0100 (Fri, 05 Nov 2004) $
line
Kristof Van Landschoot
Author

line
Summary: You may not even have thought of installing subversion, but once you've read how easy it is, you may have some ideas on what to do with it. It can do more than just Version your Source Code, you know. For instance, it can manage the versioning of this website rather well.
line
Copyright 2003-2004 Coin-C bvba. Questions, Comments, Corrections? Email knoppix@coin-c.com.