[mod_python] Using mod_python Berkeley DB XML, XmlManager, with MacOSX Tiger/Leopard/SnowLeopard (again)

Graham Dumpleton graham.dumpleton at gmail.com
Tue Dec 15 22:11:05 EST 2009


2009/12/16 Peter Robinson <p.m.robinson at bham.ac.uk>:
> Graham
> you are right: I started out installing mod-python, then realized that mod¥wsgi is now the way to go. I posted to the mod python group because that was where the earlier correspondence was.
> So, yes, I see now that the magic line is
> WSGIApplicationGroup %{GLOBAL}
> but where should this go... the google site does not make this clear.  If I put it in httpd.conf it stops apache loading.

Technically it can go anywhere in Apache configuration files so long
as it is after where mod_wsgi module was loaded. Normally one would
put it in Directory block that you created to allow Apache/mod_wsgi to
use WSGI script file from location you put it.

What is the actual error message?

If you are getting an error message with that then likely to be one of
the following:

1. You aren't actually loading mod_wsgi using LoadModule line.

2. You placed the directive in Apache configuration files prior to
where the LoadModule line is parsed from.

3. You spelt the directive wrong or much up the argument so it isn't
being interpreted as a single argument.

Have you even tried a simple hello world WSGI program to verify your
mod_wsgi installation is correct?

Perhaps go back and do that. See:

http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

Also have a read of the other more basic documentation on the mod_wsgi site.

Graham

> Should it go in the swig file?
> Peter
> ________________________________________
> From: Graham Dumpleton [graham.dumpleton at gmail.com]
> Sent: Wednesday, December 16, 2009 2:30 AM
> To: Peter Robinson
> Cc: mod_python at modpython.org
> Subject: Re: [mod_python] Using mod_python Berkeley DB XML, XmlManager, with    MacOSX Tiger/Leopard/SnowLeopard (again)
>
> If you are using mod_wsgi, why are you asking on the mod_python list?
>
> This particular issue for mod_wsgi is documented in:
>
> http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API
>
> It explicitly tells you to use:
>
>  WSGIApplicationGroup %{GLOBAL}
>
> This is equivalent to the mod_python version of setting
> PythonInterpreter to main_interpreter. Although the mod_python way
> only works for mod_python, as the above only works for mod_wsgi.
>
> Also be aware that if you still load mod_python at same time into
> Apache, you might encounter over issues or loose some functionality of
> mod_wsgi. If you no longer need mod_python, do not continue loading it
> into Apache.
>
> Graham
>
> 2009/12/16 Peter Robinson <p.m.robinson at bham.ac.uk>:
>> Indeed I am using mod_wsgi. However, I cannot see how to set PythonInterpreter to 'main_interpreter'. So far as I can judge, this should be done through a declaration such as this in httpd.conf:
>> <Location /SDPublisher>
>>   SetHandler mod_wsgi
>>   PythonInterpreter main_interpreter
>> </Location>
>>
>> (according to what I could find at http://trac.edgewall.org/wiki/TracModPython)
>> but this does not work, or rather Apache will not start with this included.
>> help..!
>>
>> ________________________________________
>> From: Graham Dumpleton [graham.dumpleton at gmail.com]
>> Sent: Wednesday, December 16, 2009 12:34 AM
>> To: Peter Robinson
>> Cc: mod_python at modpython.org
>> Subject: Re: [mod_python] Using mod_python Berkeley DB XML, XmlManager, with    MacOSX Tiger/Leopard/SnowLeopard (again)
>>
>> Are you definitely using PythonInterpreter set to 'main_interpreter'?
>>
>> Are you stuck with using mod_python? Any way you can use mod_wsgi?
>>
>> Since been discovered that even in main interpreter, mod_python's
>> usage of GIL thread state APIs is wrong. The mod_wsgi module gets it
>> right, although still have to tell mod_wsgi to use main interpreter as
>> well to avoid other issues.
>>
>> Graham
>>
>> 2009/12/16 Peter Robinson <p.m.robinson at bham.ac.uk>:
>>> Folks
>>> Last March there was a thread on the problems of getting mod_python running
>>> with Apache in Mac OSX, with a very thorough discussion by Graham Dumpleton
>>> a.o. on how to make it work.  (see
>>> http://www.modpython.org/pipermail/mod_python/2008-March/024955.html ; also
>>> http://www.modpython.org/pipermail/mod_python/2007-October/024376.html).
>>>  This discussion should have solved the issue forever.  Alas, it has not ..
>>> for me anyway.
>>> In trying to run mod_python with Berkeley DB XML, in the mod_wsgi
>>> incarnation, an older problem has resurfaced.  This is to do with Apache
>>> locking up when python tries to access the key XmlManager class in bdbxml. A
>>> discussion on this list
>>> http://www.modpython.org/pipermail/mod_python/2007-April/023445.html , under
>>> the topic Global Interpreter Lock problem with Berkeley DB XML and
>>> mod_python, dealt with this.  Graham (again) suggested two fixes:
>>> 1. recompile bdbxml with the compiler option -DSWIG_PYTHON_NO_USE_GIL
>>> 2.  reinstall the python bindings, editing dbxml/dist/s_swig so that
>>> '-threads' isn't in swig_args for Python
>>> I tried the second, and this changed nothing.  I cannot figure out how to do
>>> the first (sh buildall.sh  --with-berkeleydb-conf=-DSWIG_PYTHON_NO_USE_GIL
>>> and sh buildall.sh  --with-dbxml-conf=-DSWIG_PYTHON_NO_USE_GIL fail)...
>>> so help would be really helpful!
>>> I am trying to do this on SnowLeopard.
>>
>



More information about the Mod_python mailing list