Serving svn with httpd on OS X 10.9

This article shows how to set up Apache httpd with svn on OS X 10.9, Mavericks, and Xcode 5.

Previously I documented how to set up Subversion (SVN) and Apache's web server httpd on Mac OS X 10.8, Mountain Lion.

Since then Apple has released OS X 10.9 and the steps to get httpd and svn working together have changed. Let's step through restoring svn over http on your Mac server.

Essentials

We are going to use homebrew to get the latest subversion libraries. homebrew is an excellent command line package manager. If you have not yet discovered homebrew's usefulness, today's set of steps will be the start of a revelation.

As before, be sure to install the latest Xcode and the Command Line Tools.

Download and Build Subversion

Download Subversion 1.8.5 and extract the archive's contents:

curl 'http://archive.apache.org/dist/subversion/subversion-1.8.5.tar.bz2' > ~/Downloads/subversion.tar.bz2
cd ~/Downloads
tar -xjf subversion.tar.bz2
cd subversion-1.8.5

Configure and make Subversion, but do not install:

./configure --with-apxs=/usr/sbin/apxs
make

Copy the Apache httpd modules to the appropriate folder. The location and purpose of this folder is explained in the earlier instructions. I deliberately keep custom modules and configurations outside of Apple's standard locations; Apple tends to overwrite customisations during upgrades and updates.

cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /Volumes/Documents/projects/apache2/.
cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /Volumes/Documents/projects/apache2/.

Install Subversion's Libraries

For these two Apache httpd modules to link properly at runtime, we need a handful of additional Subversion libraries. Let's use homebrew to install these:

brew install subversion

Note: You will need to install homebrew before this command works.

Test httpd's Configuration

Referring to the Subversion guide, load these two modules and set up the svn configuration you need. The two lines to load the modules from the custom folder are:

LoadModule dav_svn_module /Volumes/Documents/projects/apache2/mod_dav_svn.so
LoadModule authz_svn_module /Volumes/Documents/projects/apache2/mod_authz_svn.so

Before restarting Apache httpd, test the configuration file works. Any linking problems with the new modules will be reported with this step - assuming your configuration brings in the new modules:

apachectl -f /etc/apache2/httpd.conf -t

If all goes well, you can now restart Apache httpd and resume serving svn over http and https.

sudo apachectl restart

This article was posted in and tagged , , , and .

Published by Graham Miln on