Subversion on the Macintosh
- Move Apache 1.3 to Apache 2. This is actually much less painful that it sounds, but it's quite necessary because Subversion doesn't support anything less than Apache 2. You can try running multiple versions of Apache from one box if you like, but in my case, I found that it was easier to just make the switch. If we're lucky, Apple will put Apache 2 on Leopard, and we won't ever have to worry about this part again. Here's how you get Apache 2 on your machine:
- Run FinkCommander (you got that back when you were reading my first article on .NET development, right?)
- Install the apache2 package. That wasn't so hard, was it?
- If you're also serving up ASP.NET on this machine, rebuild mod_mono (discussed in part 2 of my .NET development series). When you run the configuration script, add --with-apxs=/sw/bin/apxs2 to the command line arguments.
- If you've installed a CruiseControl.NET dashboard (as discussed in part 3 of the .NET development series), then at the end of /sw/etc/apache2/httpd.conf, add:
Alias /ccnet "/web/ccnet"
AddMonoApplications default "/ccnet:/web/ccnet"
<Location /ccnet>
SetHandler mono
</Location>
AddMonoApplications default "/ccnet:/web/ccnet"
<Location /ccnet>
SetHandler mono
</Location>
Installing Subversion
- Run FinkCommander and install the libapache2-mod-svn package.
- Run sudo mkdir /svn, where /svn is the path where you want to store your repository.
- Run sudo svnadmin create /svn.
- Run sudo chown -R www /svn, where www is the name of the user the Apache uses.
- Edit /sw/etc/apache2/mods-enabled/dav_svn.conf; the comments should explain what you need to do here.
- Restart Apache (/sw/etc/sbin/apache2ctl -k restart).
Caveats
Sadly, I lost my notes on how to get Apache 2 to start up at boot. However, I did find this forum posting that suggests that it can be accomplished by replacing the Apache 1.3 startup scripts with links to the Apache 2 scripts.
I've also found that sometimes, even though I have Apache 2 set up to start up at boot, it fails to do so, or CruiseControl.NET fails to start (or eventually locks up). However, this happens infrequently enough that I haven't bothered to track down the root of the problem, and a reboot (or two) generally fixes it. If anyone reading this happens to stumble upon a solution to my problem, I'd love to hear about it.