2

I want to setup SVN in such a way that svn.domain.com/ directly lists SVN repositories. To be able to make the web view nicer I am using an SVNIndexXSLT. But I have to serve this file somehow to the end-user.

So I want to setup a location (/repos-web for example) that will serve files, instead of svn.

I currently have the following configuration:

<VirtualHost *:80>
        ServerName svn.domain.com
        DocumentRoot /home/user/svn/svnweb
        ErrorLog ${APACHE_LOG_DIR}/error.log
        <Location />
                AuthType Basic
                AuthName "Authentication required"
                AuthUserFile "myauthfile"
                Require valid-user
                order allow,deny
                allow from all

                DAV svn
                SVNParentPath /home/user/svn/repositories
                SVNListParentPath on
                SVNIndexXSLT "/repos-web/view/repos.xsl"
        </Location>
        <Location /repos-web>
                DAV off
        </Location>
</VirtualHost>

But http://svn.domain.com/repos-web simply returns:

Could not open the requested SVN filesystem

I tried changing the <Location /> in <LocationMatch "^/(?!repos-web)"> but this did not help at all.

Of course one solution would be to serve the xslt file over another domain/subdomain, but this is more a workaround than solution.

1 Answer 1

1

The main issue is that you cannot turn off Dav for a subfolder. So that's why most people enable Dav for a sublocation like /svn.

On the other hand, with some trickery, it can work if you use a rewrite rule and redirect to another domain which has the xsl files. You will need to set the Access-Control-Allow-Origin header on that other domain to say the original domain is ok. Something like:

<Location />
  Header append Access-Control-Allow-Origin http://www.example.com
</Location>

Your rewrite rules on your main domain would look like:

<Location /repos-web>
  RewriteEngine On
  RewriteRule .*$ http://repos.example.com%{REQUEST_URI} [last,redirect]
</Location>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .