Alex Rivera | Logout

How to enable mod_dav_svn in the root directory of a named virtual host?

Asked 2008-11-05T09:26:56.663
15

Is this possible? I had troubles with SVN clients not being able to access the repository with the following error message:

Repository moved permanently to 'http://svn.example.com/test/'; please relocate

If I added the '/' to the end of the path I was trying to access, it just strips it off again, and shows the same error message. My configuration file looks like:

<VirtualHost *>
  ServerName svn.example.com
  # Normal VirtualHost stuff here

  <Location /svn>
    # Uncomment this to enable the repository
    DAV svn
    SVNParentPath /some/path/to/repositories

    # Setup mod_authz_svn, etc, etc here
  </Location>
</VirtualHost>

Note: This works. But if I change the Location to just / it stops working again with the error above. Is it possible to use the root directory, or am I missing something here? Firefox displays the repository listing fine when serving the repositories out of the root.

As someone else pointed out, this only seems to be an issue inside named virtual hosts... Anyone have any smart ideas why?

Edit
Report

2 Answers

1

Ok, I think we have found who to blame: named virtual hosts :)

With this configuration:

<VirtualHost dave.test>
<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>

when I run the command svn ls http://dave.test I got this error:

svn: Server sent unexpected return value (405 Method Not Allowed) in response to
PROPFIND request for '/'

So apparently there is an issue when one tries to enable mod_dav_svn in the root directory of a named virtual host...

answered 2008-11-06T00:57:15.973
0
This is working for me:

<Location />
    DAV svn
    SVNPath /repository
    AuthType Basic
    AuthName "Repository authentication"
    AuthUserFile /repository/.svn-auth
    AuthzSVNAccessFile /repository/.svn-access
    Satisfy All
    Require valid-user
</Location>

Pointing the browser to http://127.0.0.1 shows me the repository content.

answered 2008-11-05T22:48:47.497

Your Answer