A very good and readable howto is available at http://www.howtoforge.com/debian_subversion_websvn. I have made some additional changes after following this guide. The guide requires you to manually add each repository manually to the dav_svn.conf file. It is possible to do this differently, in a VirtualHost configuration. Do not enable the lines in dav_svn.conf but add the following lines to your desired VirtualHost configuration, in this example with ServerName svn.example.com:
<Location>
Deny from all
Allow from 192.168
</Location>
<Location /svn>
DAV svn
SVNParentPath /var/svn/repository/
SVNListParentPath on
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /var/www/svn.example.com/dav_svn.passwd
Require valid-user
</Location>
In this configuration there are the following things to keep in mind:
- The parent folder of my SVN repository is different than the mentioned guide, /var/svn-repos is changed to /var/svn/repository
- Access to this repository is restricted to only a specific subnet (192.168.*.* which is my own local network) by the first Location directive
- All repositories are accessible via _http://svn.example.com/svn/\[name of repository] . _The usernames and passwords are configured in the dav_svn.passwd file, generated with htpasswd -c _/var/www/svn.example.com/dav_svn.passwd _(do not forget to create the folder in /var/www).