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 currently have several svn repo's set up for use by a small collection of people. They currently access there repo by the following url pattern: https://svn.example.com/svn/project If they have multiple packages (which some, but not all do) its: https://svn.example.com/svn/project/packageA and so on.

I would like to remove the /svn/ out of the url. I have tried using RewriteRule and RedirectMatch in apache with no success.

This is the virtual host file, prior to trying to change the URL:

<VirtualHost *:443>
  ServerAdmin admin@example.com
  ServerName www.svn.example.com
  ServerAlias svn.example.com
  DocumentRoot /var/svn

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/apache.pem
  SSLProtocol all
  SSLCipherSuite HIGH:MEDIUM

  <Location /var/svn/>
    DAV svn
    SVNParentPath /var/svn
    SVNListParentPath on
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /var/svn/svn-auth-file
    Require valid-user

  </Location>
  ErrorLog /var/log/apache2/error.log

  LogLevel warn

  CustomLog /var/log/apache2/access.log combined
  ServerSignature On

  </VirtualHost>

Any suggestions?

share|improve this question

2 Answers 2

Preface

  1. Your written config doesn't reflect your described config: /svn path vs /var/svn/ location
  2. You config must not work at all (or work with big troubles): DocumentRoot == Location == SVNParentPath, because they are a) unrelated b) different parameters

When you want to change path to your repos, you have to rewrite only definition of SVN-location, it can be / in your case (and beware: non-WebDAV tree under root will have problems in this case, if all site is repositories only it's OK for root-location)

<Location /> is short answer on your question

share|improve this answer

Assumption You have two svn repositories located at:

  1. /var/svn/repo1
  2. /var/svn/repo2

And so URLs would be:

  1. http://svn.example.com/repo1/project1/PackageA
  2. http://svn.example.com/repo2/project1/PackageA

Requirement To access PackageA of Project1 of repo1 using URL:

http://svn.example.com/project1/PackageA

Probable Solution

-<Location /var/svn/>
+<Location />
     DAV svn
    -SVNParentPath /var/svn
    +SVNPath /var/svn/repo1
    -SVNListParentPath on
     AuthType Basic
     AuthName "Subversion Repository"
     AuthUserFile /var/svn/svn-auth-file
     Require valid-user    
 </Location>

And, restart httpd.

share|improve this answer

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.