TL;DR: You can run this handy script to compile mod_perl for your system.
OS X 10.10 Yosemite upgrades the default Apache install from 2.2 in Mavericks to 2.4. In general, this is a good thing, but if you were using mod_perl, perhaps for mod_cfml with Railo for example, then mod_perl will no longer work.
Recently, there have been several commits so mod_perl will now support Apache 2.4. Since there are no binary releases yet, we will have to compile it ourselves.
I have managed to do this with help from this StackOverflow post.
First you need the latest source from the Apache SVN repositories. They mirror it on git, but its missing some dependencies, so I found it easier to use SVN.
svn checkout https://svn.apache.org/repos/asf/perl/modperl/trunk/ mod_perl-2.0
Then switch into the new directory:
Next, we need to be sure we have XCode 6.1 installed and the command line tools installed as well:
Once, we have that, we need to tell the compiler where to find a few dependencies. You can find the reasoning behind this in the StackOverflow post mentioned above, but in general you run:
1 2 3
This will create a couple simlinks and tell the compiler where some Apache headers are located.
Almost done. Next, we compile it. We need to set a compiler option to tell it to build using the gnu89 standard, instead of clang’s default C99. (Thanks to this blog post for that little nugget!)
perl Makefile.PL MP_CCOPTS=-std=gnu89 ; make ; sudo make install
This will install mod_perl.so to
Lastly, we need to tell Apache to load the newly compiled module and restart apache. Add this line to your
LoadModule perl_module libexec/apache2/mod_perl.so
Then restart apache:
If all is well, you should have a working mod_perl module inside Apache 2.4.