[mod_python] Using mod_python with MacOSX Tiger/Leopard.

Eric Brunson brunson at brunson.com
Mon Mar 10 21:32:55 EDT 2008


Graham Dumpleton wrote:
> On 11/03/2008, Eric Brunson <brunson at brunson.com> wrote:
>   
>>  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)
>>     
>
> Hmmm, mod_python 3.2.10 will not run with Apache 1.3. Sure you have an
> alternate version of Apache installed.
>   

Good catch.

lima(~)$ /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.59

I think OSX comes with a preinstalled apache, but this one I seem to 
have compiled myself.

lima(~/src)$ grep configure httpd-2.0.59/config.log | head -3 | tail -1
  $ ./configure --enable-mods-shared=most --enable-ssl --with-mpm=worker 
--without-berkeley-db

mod_python was configured with no command line options.

I'm guessing that due to the /usr/local/bin/mysql location of mysql and 
lack of source in my build directory that I installed it from either 
Darwin ports or possibly package from mysql, I can't remember which.

Thanks for catching that.

Sincerely,
e.

> BTW, the subversion trunk source code still requires Apache 2.X. It
> doesn't somehow magically now work on older versions of Apache.
>
> If you are wanting to use Apache 1.3 and aren't using mod_python
> specific features but just want to run WSGI capable applications,
> better off using mod_wsgi.
>
>   
>>  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.
>>     
>
> Same problem with my old G3 iBook, but then that isn't even a G4.
> Still good for surfing when watching TV though. :-)
>
> Graham
>
>   
>>  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