[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: multiple svn repositories on apache without a /svn/ path ?

From: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-11-08 20:07:29 CET

On Nov 7, 2006, at 19:01, Matthew Kerle wrote:

> Is there a way to host a collection of repositories from the root of
> a website (apache virtual host) without using a /svn/ (or other)
> context?
> I've seen a lot of advice on the net for how to do this, but it all
> relies
> on using a sub folder of some kind on the server, whereas I'd like to
> serve our projects from the root.

First off: it should be possible. It's not recommended, but it should
be possible to make it work.

The reason it's not recommended is that it causes problems with /
favicon.ico, /robots.txt, and other URLs which by de-facto standard
must be at the root of the URL space, only now they can't be if you
set up Subversion like this. Also, if you ever decide that you want
to use the XSLT styling for the browser view of these repositories
(with the SVNIndex directive), you'll need a place to put the XSLT
and CSS files, and if you map your entire namespace to Subversion
repositories, you either have to host the XSLT and CSS files on a
different virtual host with a different hostname, or you have to put
them in one of your repositories. The latter is however not such a
bad idea anyway.

[snip]
> I'd prefer to use a single location tag and the SVNParentPath
> directive
> instead, like this:
>
> NameVirtualHost *:80
> <VirtualHost *:80>
> DocumentRoot C:\svn
> ServerName svn
> <Location />
> DAV svn
> SVNListParentPath on
> SVNParentPath C:\SVN
> <LimitExcept GET PROPFIND OPTIONS REPORT>
> AuthType Basic
> AuthName "Subversion repositories"
> AuthUserFile C:\Apache\Apache2\passwd
> Require valid-user
> </LimitExcept>
> </Location>
> </VirtualHost>
>
>
> but I've run into some problems. When I setup the Virtual host
> I can browse the repo ok with Firefox, and if I go to a url lower than
> /trunk in the Tortoise repo browser it's fine (checkout,commit are
> ok),
> but when I try to browse the repo root I get a '301 Moved Permanently
> error on PROPFIND'.
>
> According to the faq this happens when the svn repo overlaps with an
> existing website or a file of the same name exists. The Server also
> hosts our wiki, but that has a completely different document root
> and when I try this I comment out all the other <Location>'s. There's
> also definitely no file/folders in the other web root that have the
> same name as the repositories, so I'm not sure whats happening.

Your VirtualHost looks mostly reasonable to me. The only thing I'd
change is the DocumentRoot, which should definitely not be C:\svn,
since there are no files in that directory that you would ever want
Apache to serve out directly; you want everything in there to go
through mod_dav_svn, which is taken care of with the SVNParentPath
directive. Point the DocumentRoot at any other directory, even an
empty directory you've created somewhere. Possibly you can even leave
the entire DocumentRoot directive out in this case; I'm not sure.

I must admit I've also never understood the LimitExcept bit, and
could only suggest leaving that out to see if it makes any difference.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Nov 8 20:08:39 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.