Linux (Ubuntu)
Ubuntu: Installing Subversion with Web Access
by admin on Feb.27, 2011, under Linux (Ubuntu)
This article covers installing subversion with the apache module, allowing users to easily access it via a public network like the internet. The setup requirements include a working installation of apache2 on your server.
If apache2 is not installed on your machine, you can install it using:
apt-get install apache2
Ok, now let’s install subversion:
sudo apt-get install subversion libapache2-svn -y --force-yes
I’m going to save my subversion repository to /svn
svnadmin create /svn
Now the svn configuration should be adjusted, thus I’m going to edit dav_svn.conf :
vi /etc/apache2/mods-enabled/dav_svn.conf
Uncomment the most important elements:
<Location /svn> DAV svn SVNPath /svn ... AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd ... Require valid-user </Location>
It will save the subversion repository to /svn, apply a basic authentification scheme and require a valid user (no anonymous logins will be possible).
Now create your first user which later will be used to access the subversion repository:
htpasswd -cm /etc/apache2/dav_svn.passwd beta
The username I chose was beta. It will prompt you to enter a password as well. I recommend using only the -m switch after adding your first user. This way it won’t re-create the entire file whenever you add a new user.
After adding the users you’ve to restart apache:
/etc/init.d/apache2 restart
Now you should be able to reach your subversion repository going to http://www.yourwebsite.com/svn