Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 svn repos on my EC2 instance.
They are located in /ebs/svn/repo1 & /ebs/svn/repo2.

I have created a domain alias svn.mydomain.com, to point to the parent directory of above (/ebs/svn).

I woud like to access each of the above repo's using the following URL format:
svn.mydomain.com/repo1
svn.mydomain.com/repo2

Currenly I have the repo1 working with the following vhosts config.

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

The problem is, I can only get access to repo1 through the above vhosts config.

I would like to access both repo's in the following format:
svn.mydomain.com/repo1
svn.mydomain.com/repo2

What do I need to change to access my svn repo's by their directories?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

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›
share|improve this answer
    
Thanks, This worked much better, Now it lists all my repos, I have updated my answer with the vhosts I used. Thanks! +1! –  JustAnil Dec 27 '12 at 13:04
    
Was getting double teamed by "forbidden" and "Could not open the requested SVN filesystem" errors all morning. Thanks for the answer! –  sealz Jul 30 '13 at 15:11
add comment

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>
share|improve this answer
1  
You can do that, but it requires you to add every new repo seperately. Also check out my answer for a more generic approach. –  Oldskool Dec 27 '12 at 12:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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