08.04.08

apache 2/mod_python on OS X

Posted in Web authoring, scripting, python at 3:12 pm by karl

I am beginning to understand why the mighty python is not more widely adopted for web development. I just tried to install mod_python on my MacBook Pro running OS X 10.5. I did the usual thing of downloading the source, untarring it and running

./configure --with-apsx=/usr/sbin/apsx

make

sudo make install

No complaints from any of these 3 commands. “Hurray”, I thought. I then edited /etc/apache2/httpd.conf to include the line

LoadModule mod_python libexec/apache2/mod_python.so

and restarted apache. No joy. Apache dead.

It turns out I had to edit the Makefile in the src/ directory after I ran configure. Isn’t that the whole point of configure? Bah! The solution is to be found on the Wired blog (you need to add -arch x86_64 in 2 places in the Makefile).

I had similar problems getting mod_python to run under RedHat ES 4 on a 64-bit machine - it looks like configure fails silently on 64 bot architectures. I promised myself I would blog the steps required to get everything running on RedHat but I haven’t done it yet. It would be lovely if someone in mod_python would take action over this stuff, as it’s a great shame that an otherwise excellent module falls over at the first hurdle. Hmmm, maybe I should do it instead of just moaning (alas I don’t think I have the l33t skillz required…)

EDIT: Graham Dumpleton pointed out that the problems with RedHat were not in fact to do with mod_python, but rather that a shared library 64-bit version of python needs to be installed. He is of course right. Thanks Graham!

Leave a Comment

You must be logged in to post a comment.