Setting up a SVN server on an Ubuntu Vserver running Plesk is smooth like butter. Mmmh, butter… Just for future reference, i’m going to explain it here.
Update: Configuration of basic authentication is included now.
First, install subversion and the Apache library with the command
sudo apt-get install subversion libapache2-svn
Next, enter the Subversion/Apache configuration into the vhost.conf file of the respective domain, e.g. /var/www/vhosts/[DOMAIN NAME]/conf/vhost.conf. This file contains all the important Apache stuff for the subdomain.
SVNParentPath /var/www/vhosts/[DOMAIN NAME]/svn
# The following three lines allow anonymous read, but make
# committers authenticate themselves.
<LimitExcept GET PROPFIND OPTIONS REPORT>
AuthName "SVN Authorization Realm"
AuthUserFile /var/www/vhosts/[DOMAIN NAME]/svn/svnAuthUsers.passwd
What is left is to create an example repository, restart Apache
cd /var/www/vhosts/[DOMAIN NAME]
svnadmin create svn/test
chown -R www-data:www-data svn/
sudo /etc/init.d/apache2 restart
and to test it from your home computer
svn co http://www.[DOMAIN NAME]/svn/test
To allow you – and only you – to commit new files, authentication has to be configured. Run the following command on the the server, using your local user name for convenience:
htpasswd -c /var/www/vhosts/[DOMAIN NAME]/svn/svnAuthUsers.passwd [USERNAME]
You will be prompted for a password. Commiting new files and directories should work now as well. And that’s pretty much it!
To allow only authenticated users to checkout the repository, remove both lines containing the “LimitExcept” from the vhost.conf file. Another excellent explanation of the setup process is to be found here.