[mod_python] Using mod_python with MacOSX Tiger/Leopard.

Eric Brunson brunson at brunson.com
Mon Mar 10 21:12:24 EDT 2008


Graham,

That's an excellent proposal. Undoubtedly more constructive than my 
ill-advised rant in a previous email.  I currently have my set up from a 
year ago still runnable, but I'm probably using versions quite old by 
this weeks standards.

lima(~)$ httpd -V | head -1
Server version: Apache/1.3.33 (Darwin)
lima(~)$ python -V
Python 2.4.3
lima(~)$ locate mod_python.so
/Users/brunson/src/mod_python-3.2.10/src/.libs/mod_python.so
/Users/brunson/src/mod_python-3.2.10/src/mod_python.so
/usr/local/apache2/modules/mod_python.so
lima(~)$ python -c "import MySQLdb ; print MySQLdb.__version__"
1.2.1_p2

Everything is working and I can supply config options for those who wish 
to reproduce, but in todays terms, those versions are practically 
archaic.  I think most of the dependencies were a combination of what 
was available in Darwin Ports and what I was running at work at the 
time.  We've since upgraded to apache 2.2, python 2.5.1, mod_python 
3.3.1 and MySQLdb 1.2.2 under Solaris 10, so I'm out of date in every 
respect on OSX.

If I have some time over the next few days (weeks?), I'll try to update 
and post back results.  I'm afraid that, no matter what, I won't be able 
to comment beyond Tiger, as I've been assured my little 800MHz G4 iMac 
won't run Leopard.

Thanks for the positive direction, I hope I have some time to contribute 
more than the above.

Graham Dumpleton wrote:
> For those users of MacOS X out there who have been having problems, or
> moaning about  the state of Python/Apache/mod_python on MacOS X, I set
> you a challenge. Since you seem to be unwilling to come up with
> patches to fix the problems, or just aren't in a position to work out
> what the packages required might be, then please at least do the
> following.
>
> 1. Using a subversion client, checkout latest mod_python source code from trunk:
>
>   svn co http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk
> mod_python-trunk
>
> 2. Build the source code on your MacOS X system, whether that be Tiger
> or Leopard and whether you be using the standard OS installation of
> Python or an alternate version such as from MacPorts. Ensure you use
> --with-python to point at the version of Python you want to use. Use
> --with-apxs as necessary.
>
> 3. Install it and see if it works without you having to have made any
> changes to the source code. If you have multiple versions of Python
> installed on your system, try it with all of them to make sure all
> work. Just ensure you do a full 'stop' of Apache between testing each
> version. If you don't have code which will work with that version of
> Python, just use the mod_python testhandler.
>
> <Location /testhandler>
> SetHandler mod_python
> PythonHandler mod_python.testhandler
> </Location>
>
> 4. Respond with your results about what works and what doesn't.
>
> Hopefully the source in subversion trunk will now build on both Tiger
> and Leopard out of the box and deal with Python installations being in
> different locations. It also shouldn't pick up the wrong framework
> where multiple framework versions of Python are installed. On Leopard,
> it should also ensure that the mod_python.so file and the psp C
> extension module are built with the same architectures that your
> Apache binary is built with.
>
> Do note, I haven't myself been able to set this on Tiger yet, but
> believe it should work. Also, because this affects the main build
> process and because I replaced whole sections of configure script code
> with stuff from mod_wsgi which I know works properly, then building
> code for other platforms may also be affected. Thus, if you have
> access to other platforms besides MacOS X, then test it there as well.
>
> So rather than complaining, here is your chance to help out and
> improve the situation. :-)
>
> BTW, Apple has documented the issues with building Python C extension
> modules for additional architectures. It can be found at:
>
>   http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/index.html
>
> This is referenced along with other stuff about the sorts of problems
> that crop up on MacOS X at:
>
>   http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX
>
> Graham
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>   



More information about the Mod_python mailing list