Categories:

Installing SVN Server on Ubuntu

Posted 20120101. Last Updated 20120101.

This assumes you have install Apache 2 Webserver.

First, install subversion and the library for Apache:
sudo apt-get install subversion libapache2-svn

Then create a new directory for the repository using the svnadmin command. This directory can be anywhere
sudo svnadmin create /var/lib/svn

Create a user for using the svn repository
sudo htpasswd -cm /etc/apache2/dav_svn.passwd USERNAME

Youll now have to configure the conf file for svn:
sudo nano /etc/apache2/mods-enabled/dav_svn.conf

Uncomment the following lines:
DAV svn
SVNPath /svn Change this path to the one you created
AuthType Basic
AuthName Subversion Repository
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user

After you restart Apache, youll be able to access your svn repository!
sudo /etc/init.d/apache2 restart