Sunday, July 23, 2006

HOWTO: Set up subversion under Debain

Ok, so I have spent the last couple of days battling with Subversion, and I have gone from various states of working to non-working systems, I now have a working one. You will probably find this useful if you are using the svnserve program and are getting "malformed network data" errors.

At first, I followed the subversion book's method for running svnserve (they recommended making inetd run it), but that stopped working for me so I have come up with a new method. Here is a basic setup process.

First you want to install subversion, at the prompt simply type (obviously not the >):

> apt-get install subversion


Next you want to set up a repository, this can go anywhere, I put mine in /srv/svn, type:

> svnadmin create /path/of/repository


Where of course, you substitute "/path/of/repository" for the actual path to your repository. The next step is to fire the server up. This is easy, type:

> svnserve -d


Now when you want to access your repository you should access it via:

svn://hostname/path/to/repository

If you would rather not give out the absolute path to your repository, you can fire svnserve up with "-r /path/to/repository" as follows:

> svnserve -d -r /path/to/repository

You can now access your repository via:

svn://hostname/

Now, the interesting part, make sure svnserve fires up when your server fires up.

navigate to /etc/init.d and make a copy of the file reboot, call it subversion. Next, edit that file, and replace the lines where it says:

echo -n "Rebooting... "
reboot -d -f -i


With

echo -n "Starting subversion... "
svnserve -d -r /path/to/repository


Then do:

> chmod 755 subversion
> update-rc.d subversion defaults 20


And that should do it! You now have a working subversion setup.

Notes:

- If you have been battling with the setup recommended in the subversion book, make sure you delete the entry from your /etc/inetd.conf file.

No comments: