How to enable mod_dav_svn in the root directory of a named virtual host?
The problem is that you are using the document root also as the repository root (I'm not blaming you, this should just work, but it doesn't).
Try pointing the DocumentRoot
and SVNParentPath
directives to different physical locations, so the resulting config file should look like this (abbreviated):
<VirtualHost *:80> DocumentRoot /home/svn.example.com/docroot <Location /> SVNParentPath /home/svn.example.com/svnroot SVNListParentPath on </Location></VirtualHost>
Also, as @Nigel Jewell says, remove that Rewrite block, for sanity.
Continuing from comments to my previous answer, I've tried also with a VirtualHost:
<VirtualHost 127.0.0.1:80><Location /> DAV svn SVNPath /repository AuthType Basic AuthName "Repository authentication" AuthUserFile /repository/.svn-auth AuthzSVNAccessFile /repository/.svn-access Satisfy All Require valid-user</Location></VirtualHost>
and it's working, I can browse the repository with firefox and can access it with the svn command line client.
Found this in /etc/apache2/conf.d/subversion.conf (need to map error documents to defaults):
<VirtualHost *> ServerName svn.example.com ErrorLog /var/log/apache2/svn.example.com-error_log TransferLog /var/log/apache2/svn.example.com-access_log # # Do not set DocumentRoot. It is not needed here and just causes trouble. # # Map the error documents back to their defaults. # Otherwise mod_dav_svn tries to find a "error" repository. # ErrorDocument 400 default ErrorDocument 401 default ErrorDocument 403 default ErrorDocument 404 default ErrorDocument 405 default ErrorDocument 408 default ErrorDocument 410 default ErrorDocument 411 default ErrorDocument 412 default ErrorDocument 413 default ErrorDocument 414 default ErrorDocument 415 default ErrorDocument 500 default ErrorDocument 501 default ErrorDocument 502 default ErrorDocument 503 default # <Location />... </Location>
After I've done this everything started working as expected.