As a follow on from Django on OS X - getting started here’s what happened after I took Stuart’s advice, installed Xcode and atempted to add mod_wsgi to apache. Before I start let’s just clarify that I’m using MAMP Pro 1.7 on my MacBook Pro running OS X 10.4. This provides me with Apache/2.0.59 (Unix) PHP/5.2.3 DAV/2. If you want to confirm your own apache version you can type the next line into a Terminal:
/Applications/MAMP/Library/bin/httpd -v
Server version: Apache/2.0.59
Server built: Jul 6 2007 09:28:15
I also confirmed my running Python version like this:
python -V
Python 2.4.4
It should be remembered that installing MAMP leaves the standard OS X Apache running and available:
/usr/sbin/httpd -v
Server version: Apache/1.3.41 (Darwin)
Server built: Feb 22 2008 09:40:56
Downloaded mod_wsgi-2.0.tar.gz and unpacked using tar xvzf mod_wsgi-2.0.tar.gz
Cribbing Stuart Colville’s post on compiling mod_python I tried his configure command:
matt$ ./configure --with-apxs=/Applications/MAMP/Library/bin/apxs --with-python=/usr/local/bin/python
checking Apache version... cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
./configure: line 1: /: is a directory
/usr/bin/lipo: Can't map input file: / ((os/kern) invalid argument)
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
So I tried a configure without options as suggested in the installation docs
matt$ ./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 1.3.41
checking for python... /Library/Frameworks/Python.framework/Versions/Current/bin/python
configure: creating ./config.status
config.status: creating Makefile
Which kinda works except it’s found the non-MAMP apache. Using a clue from phpinfo.php in the section Configure command I tried
matt$ ./configure --with-apxs2=/Applications/MAMP/Library/bin/apxs
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 1.3.41
checking for python... /Library/Frameworks/Python.framework/Versions/Current/bin/python
configure: creating ./config.status
config.status: creating Makefile
Still not the result we’re after. Being somewhat out of my depth with the intricacies of compiling I’m not sure
- why apsx2 isn’t found
- why it should then point to the ‘old’ Apache.
While I scratch my head and figure that out I’m off to download the source of MAMP 1.7.1 - looks like they’ll be a Part 3 to this.
Resources used
http://code.google.com/p/modwsgi
http://groups.google.com/group/modwsgi
http://blog.dscpl.com.au/


5 responses so far ↓
1 Graham Dumpleton // Apr 21, 2008 at 2:05 am
It would appear that MAMP installation is inadequate in not providing the necessary tools and files to build additional Apache modules against it. You should probably complain to the MAMP people, but if you want some help in at least debugging the problem, come over to the mod_wsgi list on Google groups.
BTW, mod_wsgi configure script doesn’t have a –with-apxs2 option, you just need to use –with-apxs. You can refer to either a apxs or apxs2 program, the configure script will work out everything else automatically, ie., which version of Apache used etc.
2 Matt Bracewell // Apr 23, 2008 at 12:55 am
Thanks Graham, I’ve been busy upgrading my MAMP from 1.7 to 1.7.1 as the source for that version is available too. I hoped it’d save a load of grief as those using mod_python avoided some of the hassle that Stuart encountered. Although the upgrade was hassle free it’s got me no further installing mod_wsgi so I’ll be over to the Google list shortly.
3 Dane Thomas // Jun 17, 2008 at 12:45 pm
Hi Matt just wondering if you found out a way to install mod_wsgi with MAMP. I’m in the same boat on 10.5.3 with MAMP Pro 1.7.1 installed and am interested in getting Django up and running.
4 Joshua Jonah // Jun 18, 2008 at 1:48 am
I resolved this.
You need it compile another Apache v2.0.59 in another place and put the resulting “build” folder in “library”.
Mamp doesn’t come with this folder as you didn;t compile it, it’s just a set of folders that is copied onto your machine by the installer, I am currently working on a modified version of MAMP 1.7.1 that will contain mod_wsgi
Hope this helps you guys.
5 Matt Bracewell // Jun 18, 2008 at 11:33 am
Thanks Joshua!
My reply to Dane was going to be along the lines that I’ve ignored the entire Apache route for my Django learning process and I thought I’d probably skip from the development server straight into a hosted solution (maybe Google’s?)
I look forward to your MAMP mod. Where can we find out more?
Leave a Comment