svnvisualsvn-servercollabnetsubversion-edge

Creating an svn repository served as https://servername/svn in Windows?


The computer hosting our Subversion repository has died, and I'm trying to restore a backup onto a different computer. To minimize the hassle on the clients' end, I want to keep the same base URL, which is of the form:

https://servername/svn

That was hosted on a FreeBSD machine; the only machines I have available at the moment to restore the repository to are Windows. So I looked for a Windows-based Subversion server, and have tried both VisualSvn and CollabNet SubversionEdge, but ran into the exact same problem with both of them, which is this:

If I ask them to create a repository called "svn", they create a repository that is accessed as:

https://servername/svn/svn

If I instead ask them to create a repository named "/", or with no name, they simply give an error message saying that it's an invalid name.

How can I create a repository, using one of these products (or some other Windows svn server) that is accessed as just "/svn" instead of "/svn/somethingelse"?


Solution

  • You might have to (gasp!) manually configure it. To do that, you probably have to use CollabNet's Subversion Edge. VisualSVN is easier to use, but will overwrite any change you make in the Apache configuration unless you get the Pro version.

    It's actually very simple. There are two ways to configure Subversion in Apache:

    Way #1: Use a parent directory

    <Location /svn>
       DAV svn
       SVNParentPath /opt/repos
       ....
    </Location>
    

    When you use this method, all Subversion repositories under /opt/repos will be in Subversion under the /svn directory. Most automated systems use this method because it gives you an easy way to configure multiple repositories with only a single Apache configuration.

    If your Apache server is http://servername, and you have a subversion repository svn under /opt/repos/svn, your URL for that repo will be http://servername/svn/svn. The advantage is if you want another Subversion repo, you can simply add it to the /opt/repos directory, and it's all configured.

    Way #2: Configure Each Directory

    <Location /svn>
       DAV svn
       SVNPath /opt/repos/svn
       ....
    </Location>
    

    This allows you to configure one and only one Subversion repository each time. For each <Location ...>. However, this way allows you to specify the root directory. In this case, your URL would be http://servername/svn. As I said, you have to modify the Apache setting yourself, but it's not that difficult. The Subversion manual has the information you need.

    If this was Linux/Unix, the files would be under /etc/httpd. There would be a conf directory containing the base httpd.conf file and a second directory called conf.d that contains the subversion.conf or svn.conf file that contains these changes.

    With Collabnet on Linux, it's under /opt/collabnet/etc/conf or something like that. I have no idea where it's placed on Windows, but the file that needs changing will have the *.conf suffix, and will be fairly short.