Saturday, 26 December 2009

Installing SubVersion with Apache2 on Ubuntu 9.10

First start off by installing Apache:

sudo apt-get install apache2

Enter the root password and follow the instructions. Check that is it installed correctly by going to http://localhost and checking that you see the standard Apache "It works!" message. Then install subversion and the subversion Apache module:

sudo apt-get install subversion libapache2-svn

Then create a directory to store repositories in:

sudo mkdir /var/svn/
sudo mkdir /var/svn/repositories


and create a test repository:

sudo svnadmin create /var/svn/repositories/test

So that Apache can read and write the repository its user (www-data) needs to be given ownership of it:

sudo chown -R www-data:www-data /var/svn/repositories/test

To be able to authenticate users who access the repository a password file is needed:

sudo htpasswd -c /etc/subversion/passwd paul

Enter a password for the user paul. For additional users repeat the command without the -c option to make sure the existing file is appended to rather than replaced.

Then edit the Apache config file:

sudo gedit /etc/apache2/apache2.conf

Add the following to the end of the file:

<Location /svn>
DAV svn
SVNParentPath /var/svn/repositories/
AuthType Basic
AuthName "Test"
AuthUserFile /etc/subversion/passwd
Require valid-user
</Location>


Save the config file and restart Apache:

sudo /etc/init.d/apache2 restart

The Test repository can now be accessed via http://localhost/svn/test

Reference

https://help.ubuntu.com/9.10/serverguide/C/subversion.html

2 comments:

  1. how do i find out what svn version been installed in the server ?

    ReplyDelete