I have a couple of subversion repositories which are working fine. I can check out via protocols svn and svn+ssh.

In order to check out the repositories behind a restrictive firewall I wanted to enable http(s) access via Apache mod_dav_svn.

The repositories are accesible via browser but as soon as I try to check out a repository I get an svn: Repository moved to 'url'. If I try to check out like this:

svn co https://servername/repo

it tells me that it moved to https://servername/repo/ (note the trailing slash) and if I try to check out that exact url I get the moved permanently again but the url is the same as the one I entered.

This is the apache config in use for the repositories:

<VirtualHost *:443>
ServerName servername
ServerAlias servername

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/crt
SSLCertificateKeyFile /etc/apache2/ssl/key

DocumentRoot /svn

<Location />
Order allow,deny
Allow from all

DAV svn
SVNParentPath /svn
SVNListParentPath on
AuthType Basic
AuthName "SVN"
AuthUserFile /svn/users
#AuthzSVNAccessFile /svn/acl
    Require valid-user

Does anyone have any hints or pushes in the right direction?


From SVN Book

Be sure that when you define your new Location, it doesn't overlap with other exported locations. For example, if your main DocumentRoot is exported to /www, do not export a Subversion repository in <Location /www/repos>. If a request comes in for the URI /www/repos/foo.c, Apache won't know whether to look for a file repos/foo.c in the DocumentRoot, or whether to delegate mod_dav_svn to return foo.c from the Subversion repository. The result is often an error from the server of the form 301 Moved Permanently.

For this reason, I prefer never have SVN-location in the root of VHost and, for me, DocumentRoot /svn + SVNParentPath /svn seems as big no-no.

Just in paranoid-mode (can't refer directly on authoritative source) I always have

  • SVN-location as node deeper root in web-tree
  • SVNParentPath placed outside web-tree
  • Trailing slash in Location and SVNParentPath| SVNPath parameter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.