views:

473

answers:

3

I have the following setup:

<VirtualHost *:80>
    ServerName svn.project1.com

    <Location />
       DAV svn
       SVNPath /svn
    </Location>
</VirtualHost>


<VirtualHost *:80>
    ServerName svn.project2.com

    <Location />
       DAV svn
       SVNPath /svn
    </Location>
</VirtualHost>

When I navigate to either http://svn.project1.com/ or http://svn.project1.com/ it gives a directory listing with both repositories:

Revision 1270: /

* project1/
* project2/

Powered by Subversion version 1.4.4 (r25188)

How do I get both hosts to point to their respective repositories?

I want to be able to use urls like:

http://svn.project1.com/trunk/

Instead of:

http://svn.project1.com/project1/trunk/

And thus prevent access to e.g. project2 from project1 viz:

http://svn.project1.com/project2/

Thanks!

A: 

Not sure, but have you tried this?

SVNPath /svn/project1/
Seb
That didn't work: $ ls /svn conf dav db format hooks locks README.txt- the repositories aren't mapped to the filesystem
EoghanM
Then your file system is seriously fubared. DavSVN isn't working magic when it comes up with the listing.
Samuel
Run `find /svn -type d -print | sort` and update us with the structure (censoring names if you need to)
Samuel
I think this is pretty standard - no project subdirectories present:/svn/svn/conf/svn/dav/svn/db/svn/db/revprops/svn/db/revs/svn/db/transactions/svn/db/transactions/6-1.txn/svn/hooks/svn/locks
EoghanM
+2  A: 

This works with SVNPath /svn/project#. But be aware, I think this only works if you really have two seperate repositories. As far as I can tell from your information, you're using one repository for both projects.

Koraktor
Yes, they are both in the same repository - do I really have to mvoe them each to their own repository?
EoghanM
Yes, SVNPath only gives the physical path of the repository. So you can only address the repository root with a VirtualHost. Everything beyond that can only achieved by appending the path to the URL.
Koraktor
A: 

While using

SVNPath /svn/projectX/

should fix your problem, it will expose a serious flaw in DavSVN. The flaw that it has problems with being at the root directory of a domain. Getting random checkin errors that at present, have no solution available, was such a problem we had to switch from a subdomain to a subdirectory.

Samuel