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.

6 comments:

  1. It solves it for me. Thank you lots!

    ReplyDelete
  2. Worked for me, I was pulling my hair out on this one!!

    ReplyDelete
  3. didn't work for me either
    windows 7
    apache 2.4.9

    ReplyDelete
  4. I was able to get this fixed by updating the subversion server (one made for 2.4.9) copied the module files over as normal and tada! works. think this might be a apache version & subversion issue. for some. thought i'd share my fix.

    ReplyDelete
  5. Perfect - thanks! A more verbose error from httpd would have been nice but I have learned a bit more about the integration between subversion and apache now.

    ReplyDelete