Update 2009-10-23: This post is totally obsolete. Snow Leopard is out and mod_wsgi 2.5 is available in macports.
Graham Dumpleton released mod_wsgi 2.5 today. He’s has implemented workarounds on the issues I had while compiling mod_wsgi 2.4 with macports python 2.6.
Getting mod_wsgi to work on your precious mac is now as easy as
$ wget http://modwsgi.googlecode.com/files/mod_wsgi-2.5.tar.gz
$ tar -xzvf mod_wsgi-2.5.tar.gz && cd mod_wsgi-2.5 && ./configure
$ make && sudo make install
Don’t forgett to restart apache afterwards. 1.1 is still the latest version of mod_wsgi in macports. Don’t use it, it’s obsolete. If you still have problems getting mod_wsgi 2.5 to work, check the details of the changelog and my previous post about mod_wsgi 2.4 with macports python 2.6.
[...] 2009-05-11: mod_wsgi 2.5 is now available, check out my post on mod_wsgi 2.5 with macports python 2.5 [...]
Just a note – this can fail on modern OS X intel systems because macports binaries are compiled against only one architecture. If you use your /opt/local/Library/Frameworks/Python.framework, it is very likely i386 only.
This means that you run into architecture incompatibilities on the last line of your instructions (make). The fix is to open the Makefile after step 2, and remove all PPC and x68 architecture references.
(just change line 22 and 23 to this:)
CFLAGS = -Wc,’-arch i386′
LDFLAGS = -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -arch i386
cheers!
PS: I should add that this will NOT work if you have a newer 64 bit enabled CPU. My Core Duo is fine, a Core 2 Duo will fail. That is because apple’s apache runs as a 64 bit executable on those cpus. If you get hit by this (watch the console), you need to read up here:
http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX
Have you tried this with macports python 2.6.2 under snow leopard? It keeps linking to the the OSX install of python, as if it’s ignoring the LDFLAGS all together, or I am just doing it wrong =)