Getting SVN working with WebDAV on Windows...

... is apparently not possible if you're running Apache 2.2. So say my fallen hair and this forum discussion. Unfortunately, that's the version of Apache that the latest XAMPP comes with. (XAMPP is an excellent one-click LAMP++ installer for Windows.)

So what is a poor geek to do?

Well, I first looked at the list of WAMPs (not a gallery of really sexy women, unfortunately) on WikiPedia and decided to download VertrigoServ (which I proceeded to erroneously call "Vertigo Serv" from there on) based on the version of Apache it comes with (2.0.58) -- the last known version in which mod_dav_svn.so works correctly (at least under Windows.) Unfortunately, VertrigoServ is quite a lightweight distribution when compared to XAMPP. I realized only after installing it, for example, that it didn't have PEAR installed. Installing PEAR, fortunately, was not difficult (the instructions at go-pear.org are very easy to follow -- I just ran the script through my browser and it worked a charm.) The real show stopper, however, was that Apache in VertrigoServ isn't compiled with mod_dav.so. Oh boy, back to the drawing board!

Next stop: Apache2Triad! (No, it's not a first-person shooter!)

I was a little apprehensive about downloading the 1.4.4. stable release of Apache2Triad as it contained Apache 2.0.55 not 2.0.58 but I couldn't find any horror stories about SVN not working with 2.0.55 so I proceeded to download it. (And, anyway, I seem to be getting amazing download speeds at the moment on my 8mbit line. I hope this keeps up!)

Aaaarrgh! I didn't notice that 1.4.4 doesn't come with PHP 5! I only found this out the hard way after installing this behemoth and actually getting SVN to work on it. Apache2Triad not only includes the kitchen sink but it appears to have been written by one of those supa-ultra-geeky individuals who also seem hell bent on achieving complete and utter domination over your machine. The darn thing simply oozes character -- all the way to changing the default icon for the folder that it's installed in. (Grrr, leave my folder icons alone!) It also gave an installation error at the very end of the install and then proceeded to give me no choice about rebooting my computer. The actual control panel application didn't work but I could start Apache, MySQL, etc. manually without issue. Listen, Apache2Triad author dude, I love all the effort you must be putting into this and it's lovely that you're giving this away but please respect the fact that the computer your app is being installed on belongs to someone else, not you. Otherwise, what's to separate us from Microsoft?

So, Apache2Triad didn't work for me and I decided to try out WAMP. (At this point I'm wondering whether it would have been faster to snipe a laptop on eBay, have it delivered, install Linux on it and set things up there from source.)

After Apache2Triad, the WAMP installer comes as a breath of fresh air. It even asked me which folder I'd like to use as the DocumentRoot (intelligently defaulting to the www folder.) Oh, I love you WAMP, will you marry me? Umm, actually, no. Been there, done that (not to a one-click installer, but hey!) Let's just remain friends.

Oh how cool, it has a neato tray icon with a menu that shows all installed modules, easy links to the logs, etc. Oh man, this baby is usable! :)

So, after a little fiddling, I've finally gotten everything running under WAMP. By the way, to use SVN with Apache under Windows (so you can browse the repository via your browser, among other things), you just need to follow these simple steps:

  1. Make sure you're running an Apache version smaller than 2.2 (I've tested this to work on Apache versions 2.0.55 and 2.0.58). To save yourself trouble, install WAMP!
  2. Install Subversion using the one-click SVN installer for Windows.
  3. Copy the files mod_dav_svn.so and mod_authz_svn.so to from \Subversion\bin (or your Subversion install folder) to \Apache2\bin
  4. Open httpd.conf (under \Apache2\conf\) in a text editor
  5. In httpd.conf, uncomment (remove the #s) from the following two lines:

    LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so

  6. In httpd.conf, add the following two lines right under the ones you uncommented:

    LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so

  7. To set up an alias to the root folder of SVN, add the following to the end of httpd.conf, substituting the location of your SVN repository. [html] DAV svn SVNParentPath d:\svnrepos [/html]
Now you should be able to browse to http://localhost/svn/ to browse a project. Note that this doesn't do any authentication. Look at the SVN docs for how to set that up.

So, in conclusion, WAMP rocks and you should use SVN with Apache 2.2. Whew! :)

Comments