Suggestion: Explaining root-based virtual hosts
Jay Levitt
lists-svn at shopwatch.org
Fri Oct 21 11:29:52 CDT 2005
A common desire is to set up a VirtualHost for SVN, with the DAV at the
root, so that URLs like "http://svn.example.com/reposname" work. But
there's one problem: If you do this using SVNParentPath, *and* you have
ErrorDocuments globally defined, you won't be able to add new files to
the repository!
Reason: Committing a new file involves a PROPFIND for that file. That
results in a 404 error. That tries to load your ErrorDocument for 404.
That gets mapped to a file, say "/errors/404.html", and THAT is, of
course, within your "<Location />", so Apache passes it right back to
mod_dav_svn. Result: "500 Cannot load the requested SVN filesystem".
This seems to be the second most common cause of that error on the users
list (the first being permissions problems).
Luckily, Apache 2.0.51 and later have an "ErrorDocument xxx default"
override, which lets you unset ErrorDocument within a scope. This
solves the problem.
I think this should be documented in the section on Apache
configuration, because (a) it's a reasonably common problem, and (b)
understanding what causes it and how to fix it takes a lot of debugging
and/or Apache/SVN knowledge.
Additionally, I've found that httpd requires the DocumentRoot directive
to be present and its path accessible, even though it's not otherwise
used with DAV. I usually create an empty directory for this purpose.
Without that, you'll get "403 Forbidden" on the OPTIONS request, even if
the svn repository itself is accessible. Not sure if this is actually a
bug, but it's easy enough to work around.
So the minimal required configuration for a trouble-free root-based SVN
VirtualHost is httpd 2.0.51 or later, and:
<VirtualHost *:80>
ServerName svn.example.com
# This must be accessible, but is otherwise unused
DocumentRoot "/srv/www/htdocs/empty-dir"
<Location "/" >
DAV svn
SVNParentPath "/srv/svn/"
ErrorDocument 404 default
</Location>
</VirtualHost>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.red-bean.com/pipermail/svnbook-dev/attachments/20051021/fc6d388f/attachment.html>
More information about the svnbook-dev
mailing list