Should I not be able to have a configuration where I serve SVN repos with SVNParentPath at <Location /> and then override DAV and host normal files using another location <Location /foo>? I wish to host my XSLT files on the same subdomain and still host repos at root. Of course, if I was to have a repo called foo, that would not be accessible, and that's ok.

<VirtualHost *:80>
    ...
    #Host XSLT files here
    <Location /foo>
        DAV Off
    </Location>

    #Host my repos relative to root, such as /my_repo/
    <Location />
        DAV svn     
        SVNParentPath "myrepos"
        SVNListParentPath on
        SVNIndexXSLT "/foo/my.xsl"
        ...
    </Location>
</VirtualHost>

But DAV SVN still looks for a repo:

<?xml version="1.0" encoding="utf-8"?>
<D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
<C:error/>
<m:human-readable errcode="720003">
Could not open the requested SVN filesystem
</m:human-readable>
</D:error>

Edit: I read up on mod rewrite a bit and so far as I understand it the target path of a rewrite rule can only be local unless you use redirect [R]. This for example works, it creates a redirect (HTTP 302):

RewriteEngine On
RewriteRule ^/foo/(.*)$ http://someotherhost/foo/$1 [R]

However, it still doesn't work with SVNIndexXSLT. Probably because it doesn't follow redirects.

link|improve this question
feedback

2 Answers

"Note, that once you have DAV enabled for some location, it cannot be disabled for sublocations." (emphasis theirs)

You can try mod_rewriting your way out of this one. If you had a

RewriteRule ^/foo/(.*)$ /some/local/directory/$1 [L]

Theoretically that might evade DAV, since without the PT flag it shouldn't hand the request off to any other module. Worth a shot, at least.

If it doesn't work, be sure to reply to this so someone else trying this will see that it can't be done ;)

link|improve this answer
I'll try that, thanks – mandrake Jan 7 '11 at 18:26
Ok, I've tried it and it works, sort of. But not with SVNIndexXSLT. See my edited question for details. – mandrake Jan 9 '11 at 12:02
@mandrake: My guess is that SVNIndexXSLT is used by mod_svn_dav internally so it needs to be stored locally. Maybe you could make a separate /xslt folder and use /foo for everything else? – DerfK Jan 9 '11 at 15:03
You mean to have the repos served under /repos/*? Yeah, that would work, but I was trying to avoid it. And if I had the repos there I wouldn't need the rewrite either since DAV can be disabled. – mandrake Jan 10 '11 at 7:23
feedback

Simply host svn at svn.example.com, and keep / for normal http.

link|improve this answer
Do you mean to host at svn.example.com/svn and root for normal hosting? I wanted to avoid that solution. Or do you mean to configure SVNIndexXSLT to point at another host? Because that's not supported. – mandrake Jan 9 '11 at 11:50
feedback

Your Answer

 
or
required, but never shown

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