Supporting multiple Subversion (SVN) repositories with Apache

My previous posts about Subversion on Debian Linux (installing, configuring, backported packages) showed how I installed and configured my local repository that I use for my home projects. I also used these tutorials when installing Subversion at work.

After creating a couple of repositories for different teams (all within the base /svn directory) I noticed that my Apache configuration file was starting to look a little repetitive:

# Subversion - team A
<Location "/a">
DAV svn
SVNPath /svn/team-a
SVNIndexXSLT "/svnindex.xsl"
</Location>

# Subversion - team B
<Location "/b">
DAV svn
SVNPath /svn/team-b
SVNIndexXSLT "/svnindex.xsl"
</Location>
I plan on creating at least two more repositories for other teams and so this was repetition was starting to bother me. A colleague pointed out that SVNParentPath (scroll about 1/4 down) should be the solution.
I rewrote my conf file to be the following:
# Subversion
<Location "/svn">
DAV svn
SVNParentPath /svn
SVNIndexXSLT "/svnindex.xsl"
</Location>

Now any repositories that are created within the parent /svn directory will be available via http://some-url/svn/<repository name>, so my existing repository become:

http://some-url/svn/team-a
http://some-url/svn/team-b

Technorati Tags: , , ,

3 comments:

niksu said...

Thanks, just what I needed.

Anonymous said...

Thanks a lot. This was exactly what I needed.
The only question is...
You tell nothing about the structure of the XSLT file.
Is it necessesary to create it?

Anonymous said...

Thanks!!!