One of my duties at work involve maintaining an SVN server. The machine had an old FC1 distribution, and I have never felt really comfortable in that machine. I always felt the commands like yum, rpm etc were painful. Since I recently switched to Debian Sarge at home, and felt confortable maintaining it, I decided it was time to upgrade the server as well. This series of posts is not about Debian install (which is straight forward), but about getting svn, apache2, php, mysql etc working in that machine.
Note : I had unrestricted access to the debian mirrors and a few other hosts on the internet. I have no idea how tough it would be to install these without the network connection, but, if I had to guess, I would say it would be mighty tough.
SVN is an open source version control system that aims to solve some of the problems present in CVS. I had switched to SVN about an year back (I used to use CVS before that). SVN can be run on top of Apache to serve files, and can use the authentication mechanisms supported by Apache. Makes life easy for me. SVN/Apache allow me to specify the access permissions in a simple text file whereas with cvs, I would have had to manage permissions with “chmod” stuff.
It is better to compile/install apache first, and subversion later. I found this out the hard way.
Step 1: Installing Apache2
Installing Apache 2 in debian is as simple as issuing an “apt-get install apache2″ command from a root window. (Assuming, of course, the sources.list file is populated properly. Here is a link to a post I wrote on this). However, the default install did not support DAV, which is necessary for SVN. Solution ? compile Apache from the sources.
Apache2 source can be downloaded from http://apache.mirrors.tds.net/httpd/httpd-2.0.55.tar.bz2 . Extract the sources from the archive, and configure it using the command
./configure –enable-dav –enable-so
–enable-dav is to enable dav support needed by svn.
–enable-so is to enable modules support (needed by php).
After this (which will take a while to execute), issue a “make” command and then, as root, a “make install”. This will install apache to /usr/local/apache2.
Apache can be started using the command “/usr/local/apache2/bin/apachectl start”.
Step 2 : Installing SVN
It is better to download the svn sources and compile the binaries yourself. The source can be downloaded from http://subversion.tigris.org/downloads/subversion-1.2.3.tar.bz2 . Extract the sources from the archive.
Compiling and installing subversion can be achieved by issuing these commands
$ cd subversion-source-dir
$ ./autogen.sh
$ ./configure –with-apxs=/usr/local/apache2/bin/pxs
$ make
# make install
After these, configure apache as mentioned in subversion documentation. Thats it !