Fix Subversion with Apache on OS X Yosemite Server

I have a server, running on an old Mac Mini, which hosts some basics stuff, like an Apache server to test my website, a Redmine service, and a Subversion repository accessible through Apache.
But I recently updated my server on OS X Yosemite, with Server 4.0, and as usual with a major update of OS X Server, a lot of stuff are broken. So here I am going to explain how to fix Subversion with Apache when you are in the same situation, after an update of OS X.

Basically, when I try to start Apache, there is an error when it tries to load the 2 modules needed for SVN (mod_dav_svn.so and mod_authz_svn.so). So we need to update these 2 modules for the version of Subversion which is installed on the server.

First of all, here is my configuration file for Apache, for Subversion; this is just a quick reminder, my aim here is not to explain how to install and configure SVN and Apache on a server.

#vLockDB var/DavLock
LoadModule dav_svn_module /somewhere/subversion/mod_dav_svn.so
LoadModule authz_svn_module /somewhere/subversion/mod_authz_svn.so

<Location /svn>
  DAV svn
  SVNParentPath /Library/Server/Web/Data/Svn
  AuthName "SVN Repository"
  Require valid-user
  AuthType Basic
  SVNIndexXSLT "/Svn/svnindex.xsl"
  AuthzSVNAccessFile /Library/Server/Web/Data/Svn/authz
</Location>

So, we first have to know which version of Subversion is installed; this command will give it to you :

svnadmin --version

For me, on Yosemite with Server 4.0, it is version 1.8.8.
We now have to download Subversion sources and compile it; but, very important, we won’t install it, we will just copy the 2 files we need. Be sure to modify the following commands with your version of svn, and the correct paths on your server.

curl 'http://archive.apache.org/dist/subversion/subversion-1.8.8.tar.bz2' > /somewhere/subversion/subversion-1.8.8.tar.bz2
bunzip2 subversion-1.8.8.tar.bz2
tar -xf subversion-1.8.8.tar.bz2

cd /somewhere/subversion/subversion-1.8.8
./configure
make

Now, Subversion is build, we can get our files and copy them in the appropriate folder, the one indicated in your apache configuration file (see above)

cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /somewhere/subversion/
cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /somewhere/subversion/

And that’s all, we just have to restart our Apache server !

sudo serveradmin start web

Leave a Reply