bubblehouse |
Search |
Navigationthings |
Notes on Mod_Python and Apache 2.2 on Mac OS X
Submitted by phil on Tue, 2007-05-01 19:51.
apache | coding | compiling | unix
I'm hoping to get away from PHP in favor of mod_python, but the first thing I needed to do was get mod_python successfully working on Mac OS X. I tried once before, using the built-in Apache and Python binaries that ship with Mac OS X. At the time (I think this was still 10.4, but it could have been 10.3), the built-in Python wasn't multithreaded (or something like that) and the mod_python developers were starting to move away from Apache 1.3 altogether. I had success recently compiling mod_python on Mac OS X Server, against the distributed (but inactive) Apache 2 installation in /opt. However, I found OS X Server to be basically garbage, so I did a fresh install of the client version of Mac OS X, and set about getting Apache 2 to compile, and then mod_python. It was not easy. XCode 2.4 ToolsApache 2 compiles fine with older versions, but mod_python has problems. Make sure to install the latest version of the XCode tools, available at Apple's Developer Site. Python 2.4.4 (pythonmac.org distribution)You should be able to use any thread-enabled version of Python, but I choose to use Bob Ippolito's python distribution from pythonmac.org. Also, I did choose 2.4.4 instead of 2.5, but I would imagine 2.5 would work just as well. Expat 2.0It looks like Mac OS X 10.4.9 at least doesn't come with a up-to-date version of libexpat, so we install one. Apache 2.2.4First cd into srclib/apr and do the usual configure-make (but not install) routine Then cd into srclib/apr-util and configure it to use our precompiled apr and the new installed version of libexpat:
followed by a make (but again, no install). Finally, in the main Apache2 build directory, run this configure line to somewhat mimic the Debian style:
Tweaks and Configuration ChangesFirst of all, I had to turn off a number of extra modules I don't ever use. I like having them around, which is why I built them all, but I also discovered I don't know quite as much about which-modules-do-what as I thought I did. A little investigation later and things were good, except for the following:
Retarded Hacks to Fix aboveafter config, in include/ap_config_auto.h mod_python 3.3.1
|