You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Matthew Kerle <ma...@sra.com.au> on 2006/11/08 01:01:14 UTC

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

Hi all,
my setup is svn 1.3.1 running as an module under win32 apache 2.0.55:
(Apache/2.0.55 (Win32) DAV/2 SVN/1.3.1), server OS is Win2k.

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.

I've setup a DNS alias for the server called 'svn', so that we can access
our repositories via a url like 'http://svn/<project_name>/, and this
works fine, the only problem is that I need a separate apache
<Location> tag for each repository with the SVNPath directive, and
looking at http://svn/ just gives the apache welcome page, instead of
a list of repositories.
eg:
<Location /proj_a>
    DAV svn
    SVNListParentPath on
    SVNPath C:\SVN\proj_a
    <LimitExcept GET PROPFIND OPTIONS REPORT>
        AuthType Basic
        AuthName "Subversion repositories"
        AuthUserFile C:\Apache\Apache2\passwd
        Require valid-user
    </LimitExcept>
</Location>
(..+ others that differ only in proj name & repo path)

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.

Can anyone help me?

- Matthew Kerle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 8, 2006, at 17:34, Matthew Kerle wrote:

>> 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.
>
> 100% right! I removed the DocumentRoot declaration and the 301  
> errors stopped straight away! I guess apache was getting confused  
> between trying to serve the root itself or handing over to  
> mod_dav_svn. It's now using the apache global doc root (C:\www)  
> which is empty. The only caveat is that now I can't get the  
> "Collection of Repositories" view from browsing the root, but this  
> has solved my major issue, which was having to add a <Location> tag  
> for each repository.

What do you see instead of the "Collection of Repositories" view?


> Funny thing, this may have been occuring before, but I've noticed  
> now that if I type
> svn list http://svn/
> then on the server the apache service crashes and is automatically  
> restarted (I can tell because I'm VNC'd in, and a box pops up  
> informing me that "apache.exe has generated errors and will be  
> closed by windows....".
>
> I find the following in the apache error log:
> [Thu Nov 09 09:54:49 2006] [notice] Parent: child process exited  
> with status 3221225477 -- Restarting.
> [Thu Nov 09 09:54:49 2006] [notice] Apache/2.0.55 (Win32) DAV/2  
> mod_jk/1.2.15 PHP/5.0.3 SVN/1.3.1 mod_auth_sspi/1.0.3 configured --  
> resuming normal operations
> [Thu Nov 09 09:54:49 2006] [notice] Server built: Oct  9 2005 19:16:56
> [Thu Nov 09 09:54:49 2006] [notice] Parent: Created child process 976
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Child process is  
> running
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Acquired the start  
> mutex.
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Starting 250 worker  
> threads.
>
> It looks like mod_dav_svn is crashing and taking apache with it.  
> Does anyone know if this is a known bug with this version of svn  
> (1.3.1)?

Yes, I also experienced this with Subversion 1.3.x, and still do with  
1.4.0 now, both on Mac OS X 10.4. From my Apache error log:

[Wed Nov 08 17:45:26 2006] [notice] child pid 18317 exit signal Bus  
error (10)
[Wed Nov 08 17:45:39 2006] [notice] child pid 18321 exit signal Bus  
error (10)

 From the crash log in /Library/WebServer/Library/Logs/CrashReporter/ 
httpd.crash.log:

Thread 0 Crashed:
0   libsvn_subr-1.0.dylib 	0x011a70e4 svn_stringbuf_dup + 4  
(svn_string.c:454)
1   mod_dav_svn.so        	0x01041060 dav_svn_walk + 144 (repos.c:3400)
2   mod_dav.so            	0x0073f810 dav_handler + 3792 (mod_dav.c: 
2064)
3   httpd                 	0x0000ada4 ap_run_handler + 100 (config.c: 
157)
4   httpd                 	0x0000b418 ap_invoke_handler + 248  
(config.c:373)
5   httpd                 	0x000258cc ap_process_request + 108  
(http_request.c:258)
6   httpd                 	0x00024ea8 ap_process_http_connection +  
120 (http_core.c:184)
7   httpd                 	0x0001f104 ap_run_process_connection + 100  
(connection.c:43)
8   httpd                 	0x0002c4fc child_main + 1276 (prefork.c:641)
9   httpd                 	0x0002c6c0 make_child + 320 (prefork.c:739)
10  httpd                 	0x0002d014 ap_mpm_run + 2132 (prefork.c:861)
11  httpd                 	0x0000375c main + 3324 (main.c:717)
12  httpd                 	0x000022cc _start + 760
13  httpd                 	0x00001fd0 start + 48

I haven't been able to find a bug report on this yet, but it sounds  
like it should be reported. I'll test Subversion 1.4.2 first though.

Note, though, that "svn ls" is not supposed to be able to show you  
the list of repositories. SVNListParentPath is currently only  
intended for use within a web browser, not within a Subversion  
client. Making it work in a Subversion client would likely need to be  
a separate enhancement request.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Matthew Kerle <ma...@sra.com.au>.
[amend]
Sorry, turns out my browser was looking at the cached version of the svn 
parent, after a refresh the Collection of Repositories page came up. 
However this didn't crash apache, so it appears that a GET request is 
handled correctly, but a PROPFIND request isn't (resulting in the crash).

Matthew Kerle wrote:
> Thanks for your quick reply Ryan! You solved my main issue!
>
> Ryan Schmidt wrote:
>> 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?
>>
>> 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.
> Thats ok, we're a small development group (< 10) and we've only 
> recently moved to svn from source safe, so I don't think we'll be 
> looking at setting up XSLT transforms etc for a while yet, the team is 
> still adjusting to branching and merging...;-p Also as you say, it'd 
> probably be good to keep those files in their own repo (really good 
> idea actually!)
>>
>> [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.
> 100% right! I removed the DocumentRoot declaration and the 301 errors 
> stopped straight away! I guess apache was getting confused between 
> trying to serve the root itself or handing over to mod_dav_svn. It's 
> now using the apache global doc root (C:\www) which is empty. The only 
> caveat is that now I can't get the "Collection of Repositories" view 
> from browsing the root, but this has solved my major issue, which was 
> having to add a <Location> tag for each repository.
>>
>> 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.
>>
>>
> It's just there so I can browse the source in FireFox without having 
> to authenticate. If anything LimitExcept would make the repository 
> more open.
>
> Funny thing, this may have been occuring before, but I've noticed now 
> that if I type
> svn list http://svn/
> then on the server the apache service crashes and is automatically 
> restarted (I can tell because I'm VNC'd in, and a box pops up 
> informing me that "apache.exe has generated errors and will be closed 
> by windows....".
>
> I find the following in the apache error log:
> [Thu Nov 09 09:54:49 2006] [notice] Parent: child process exited with 
> status 3221225477 -- Restarting.
> [Thu Nov 09 09:54:49 2006] [notice] Apache/2.0.55 (Win32) DAV/2 
> mod_jk/1.2.15 PHP/5.0.3 SVN/1.3.1 mod_auth_sspi/1.0.3 configured -- 
> resuming normal operations
> [Thu Nov 09 09:54:49 2006] [notice] Server built: Oct  9 2005 19:16:56
> [Thu Nov 09 09:54:49 2006] [notice] Parent: Created child process 976
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Child process is running
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Acquired the start mutex.
> [Thu Nov 09 09:54:49 2006] [notice] Child 976: Starting 250 worker 
> threads.
>
> It looks like mod_dav_svn is crashing and taking apache with it. Does 
> anyone know if this is a known bug with this version of svn (1.3.1)?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Matthew Kerle <ma...@sra.com.au>.
Thanks for your quick reply Ryan! You solved my main issue!

Ryan Schmidt wrote:
> 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?
>
> 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.
Thats ok, we're a small development group (< 10) and we've only recently 
moved to svn from source safe, so I don't think we'll be looking at 
setting up XSLT transforms etc for a while yet, the team is still 
adjusting to branching and merging...;-p Also as you say, it'd probably 
be good to keep those files in their own repo (really good idea actually!)
>
> [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.
100% right! I removed the DocumentRoot declaration and the 301 errors 
stopped straight away! I guess apache was getting confused between 
trying to serve the root itself or handing over to mod_dav_svn. It's now 
using the apache global doc root (C:\www) which is empty. The only 
caveat is that now I can't get the "Collection of Repositories" view 
from browsing the root, but this has solved my major issue, which was 
having to add a <Location> tag for each repository.
>
> 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.
>
>
It's just there so I can browse the source in FireFox without having to 
authenticate. If anything LimitExcept would make the repository more open.

Funny thing, this may have been occuring before, but I've noticed now 
that if I type
svn list http://svn/
then on the server the apache service crashes and is automatically 
restarted (I can tell because I'm VNC'd in, and a box pops up informing 
me that "apache.exe has generated errors and will be closed by 
windows....".

I find the following in the apache error log:
[Thu Nov 09 09:54:49 2006] [notice] Parent: child process exited with 
status 3221225477 -- Restarting.
[Thu Nov 09 09:54:49 2006] [notice] Apache/2.0.55 (Win32) DAV/2 
mod_jk/1.2.15 PHP/5.0.3 SVN/1.3.1 mod_auth_sspi/1.0.3 configured -- 
resuming normal operations
[Thu Nov 09 09:54:49 2006] [notice] Server built: Oct  9 2005 19:16:56
[Thu Nov 09 09:54:49 2006] [notice] Parent: Created child process 976
[Thu Nov 09 09:54:49 2006] [notice] Child 976: Child process is running
[Thu Nov 09 09:54:49 2006] [notice] Child 976: Acquired the start mutex.
[Thu Nov 09 09:54:49 2006] [notice] Child 976: Starting 250 worker threads.

It looks like mod_dav_svn is crashing and taking apache with it. Does 
anyone know if this is a known bug with this version of svn (1.3.1)?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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