as all other modules for the standard apache installation on leopard the mod_wsgi module must be compiled as 64-bit module too.
Note that the newer versions of mod_wsgi 2.0c4 and above work out of the box. No need to patch anything. Thanks to Graham Dumpleton!
So the below instructions to patch the older versions are obsolete from now on, but still I leave them in place, as they may give hints for other purposes.
In order to do so, patch the installer:
downloaded mod_python:
wget [modwsgi.googlecode.com]
(or, if you are adventurous, like me)
wget [modwsgi.googlecode.com]
unstuff:
tar -xzf mod_wsgi-1.2.tar.gz cd mod_wsgi-1.2
(or)
tar -xzf mod_wsgi-2.0c2.tar.gz cd mod_wsgi2.0c2
configure:
./configure
now patch MakeFile:
- Add -arch x86_64 -arch ppc -arch i386 to the beginning of the LDFLAGS line (no quotes, of course).
- Add -arch x86_64 -arch ppc -arch i386 to the beginning of the CFLAGS line
- Add -arch x86_64 -arch ppc -arch i386 to the beginning of the CPPFLAGS line
and now:
make && sudo make install
now edit your apache config file (sudo nano /etc/apache2/httpd.conf) in order to load mod_python add (or uncomment) the following line:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so
You can check the architecture of your mod_wsgi module in the terminal with:
file /usr/libexec/apache2/mod_wsgi.so
It should return the following result:
/usr/libexec/apache2/mod_wsgi.so: Mach-O universal binary with 3 architectures /usr/libexec/apache2/mod_wsgi.so (for architecture ppc7400): Mach-O bundle ppc /usr/libexec/apache2/mod_wsgi.so (for architecture i386): Mach-O bundle i386 /usr/libexec/apache2/mod_wsgi.so (for architecture x86_64): Mach-O 64-bit bundle x86_64Comments:
Tuesday, 18.December 2007 04:42:45 Graham Dumpleton wrote:
Patches to makefiles for mod_wsgi and Leopard not required from 2.0c4 onwards. Ie,. will compile out of the box with mod_wsgi 2.0.