Friday, June 8, 2012

Solving mod_dav_svn loading faliure on Apache in Windows

Yesterday, I spent way too much time trying to get Subversion working under Apache in Windows 7. I really have a new appreciation for GNU/Linux package managers; what would have been sudo aptitude install libapache2-svn under Ubuntu turned into hours of staring at Syntax error on line 270 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Program Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_dav_svn.so into server: The specified procedure could not be found.

I tried copying all of the SVN libraries into bin within the server root, downloading different versions from the web, and "unblocking" the libraries (Windows blocks code downloaded from the internet. Nice idea; I only wish it would tell you about it). Finally, after hours of Googling, I found some post on some forum somewhere that mentioned using the libapr-1.dll from the Subversion distribution rather than Apache's would help. It did.

This would seem to undermine somewhat the idea of the "Apache Portable Runtime". But whatever; I have a working system. Now onto trying to get LDAP set up for SVN and Ubuntu. Wish me luck!

TL;DR: If Apache in Windows fails to start with mod_dav_svn.so loaded in your conf/httpd.conf and you get this error in your Event Viewer: Syntax error on line 270 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Program Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_dav_svn.so into server: The specified procedure could not be found., you can solve it by copying libapr-1.dll from Subversion/bin to Apache2.2/bin, replacing the version which ships with Apache.