vhost setup for multiple SVN repositories on same server

Solution 1:

Because you have set the SVNPath directive, you have "hard coded" the path:

SVNPath /ebs/svn/repo1

Try using the SVNParentPath directive instead, to configure the "top" directory that will hold all your repositories. Replace the above line with this:

SVNParentPath /ebs/svn/

If you want to allow users to view a list of all the available repositories if they just go to svn.mydomain.com, you should also add this line:

SVNListParentPath on

That will allow the listing of all your repositories. Otherwise, a "Forbidden" page will be shown on svn.mydomain.com rather than a list of repositories.

To sum up, here's a complete location block example :


    ‹Location "/"›
        DAV svn
        SVNParentPath /ebs/svn/
        SVNListParentPath On
        SSLRequireSSL
        AuthType Basic
        AuthName "svn ebs"
        AuthUserFile conf/svnpasswd 
        Require valid-user
    ‹/Location›

Solution 2:

What I did: (As answered by @Oldskool)

<VirtualHost *:80>
        ServerName svn.mydomain.com
        ServerAlias svn.mydomain.com
        ErrorLog /var/www/html/log/svn.mydomain.com-log
        <Location "/" >
            DAV svn
            # Delete SVNPath!
            SVNParentPath /ebs/svn/ # add this!
            SVNListParentPath on #Lists all the repos!! coool stuff! :D
            AuthType Basic
            AuthName "Private - Repos"
            AuthUserFile /ebs/svn/login/svn-auth-conf
            Require valid-user
       </Location>
</VirtualHost>

Thanks @Oldskool!


Old Way
This is an older way I found, but for multiple repositries, you will have to add multiple tags. (Use @oldSkool's answer above, works much better!) (Noticed the <Location "/repo1">, So basically, add a new location for each repo.

<VirtualHost *:80>
        ServerName svn.mydomain.com
        ServerAlias svn.mydomain.com
        ErrorLog /var/www/html/log/svn.mydomain.com-log
        <Location "/repo1" >
            DAV svn
            SVNPath /ebs/svn/repo1
            AuthType Basic
            AuthName "Private - Repo1"
            AuthUserFile /ebs/svn/login/svn-auth-conf
            Require valid-user
        </Location>
        <Location "/repo2" >
            DAV svn
            SVNPath /ebs/svn/repo2
            AuthType Basic
            AuthName "Private - Repo2"
            AuthUserFile /ebs/svn/login/svn-auth-conf
            Require valid-user
       </Location>
</VirtualHost>