Get VisualSVN to play nice with WebSVN and more

VisualSVN is a easy and free way to have a Subversion repository running under Windows in no time flat. That said it still leaves a lot to be desired. It has no built in bug/feature tracking, as I posted about before even getting Trac setup with it can be a pain (though if you read the comments you will see that they have remedied that with an update). Here I am going to talk about adding WebSVN and even svn:// protocol support to your VisualSVN with relative ease.

I’ve recently been working with Adam Dymitruk who has been brought into the team I am working with as our Agile coach. This has involved getting a few other things up and running along side source code versioning such as continuous integration with TeamCity and feature/bug tracking with FogBugz. Getting TeamCity up and running with VisualSVN is definitely easy enough, however FogBugz - SVN integration is somewhat dependent on having a working WebSVN installation.

VisualSVN comes with a decent, but somewhat limited web interface (in fact it is the only interface it comes with as it doesn’t even support svn:// protocol out of the box). In order to provide a bit more functionality and get it working with Fogbugz I had to get WebSVN installed. This is actually fairly simple.

Part 1: Setting up WebSVN

<Location /websvn/> 
  Options FollowSymLinks SVNListParentPath on SVNParentPath "C:/Repositories/" 
  AuthName "Subversion Repositories" 
  AuthType Basic 
  AuthBasicProvider visualsvn 
  AuthzVisualSVNAccessFile "C:/Repositories/authz-windows" 
  AuthnVisualSVNUPN Off Require valid-user
</Location>
  $config->setSVNCommandPath('C:/Program Files/VisualSVN Server/bin');
  $config->setDiffPath('C:/cygwin/bin');
  $config->setEnscriptPath('C:/cygwin/bin');
  $config->setSedPath('C:/cygwin/bin');
  $config->setTarPath('C:/cygwin/bin');
  $config->setGZipPath('C:/cygwin/bin');
  $config->setZipPath('C:/cygwin/bin');
* Setup your repository config: `$config->parentPath('C:\\Repositories');`
* Setup your authentication: `$config->useAuthenticationFile('C:/Repositories/authz');`
* Go through the configuration and set any other options you would like to use.    * Finally save `distconfig.php` as `config.php`

That should be it. Hopefully I have not forgotten anything. Restart the VisualSVN service so that it will restart apache. Now instead of going to http://localhost/svn go to http://localhost/websvn (of course, use https:// if that is how you have it configured).

Part 2: Setting up svn://

I really don’t know why but for some reason VisualSVN does not come with svn protocol enabled by default. It seems pretty silly since it is easy to do and it is a bit faster than access through http:// or https://. Nonetheless, it does come with a full SVN install and therefore it has svnserve, so just open a command prompt and we will create a service neat and quick:

sc create SVNService binpath= "c:\Program Files\VisualSVN Server\bin\svnserve.exe --service --root C:\Repositories\" displayname= "Subversion Service" depend= Tcpip

You can, of course remove the service with

sv delete SVNService

I hope this has been helpful, to be honest while I was glad I was able to get all this done, Adam shortly thereafter decided to show me Git and, well, I’m a Git convert now I guess. Let me leave you with a warning though, webgit is _not nearly as easy to set up under Windows _(I’m not sure you even can) as WebSVN is, so it looks like it will be time to switch to a Linux box (thank God…). Honestly, I am still a firm believer that if you want to use either SVN or Git you should setup a Linux box to host your repositories and to provide Apache and any web interfaces that depend on Apache. Windows was never meant to run this stuff (and screw NT authentication!)

comments powered by Disqus