[mod_python] apache + python + mod_python: path error

Graham Dumpleton grahamd at dscpl.com.au
Sat Oct 7 18:42:36 EDT 2006

On 08/10/2006, at 5:19 AM, Глотов Артем wrote:

> Hello!
>   I'm trying to install apache, python and mod_python, but to the  
> my homedir, not to  the /usr/local. During configuration I used -- 
> prefix directive:  Python:  ./configure     --enable-shared     -- 
> without-threads     --prefix=/home/glar/project/python  Apache:  ./ 
> configure     --enable-rule=SHARED_CORE     --enable-module=so      
> --prefix=/home/glar/project/apache  and Mod_python:  ./configure     
> --with-apxs=/home/glar/project/apache/bin/apxs    --with-apache=../ 
> apache_1.3.33    --with-python=../Python-2.4.3    --prefix=/home/ 
> glar/project/python/lib/python2.4
> But when I call the test example, apache generates 500 Internal  
> Error, in the
> error_log there are 3 new strings:
> [Fri Oct  6 17:36:03 2006] [notice] Accept mutex: sysvsem (Default:  
> sysvsem)
> make_obcallback(): could not import mod_python.apache.
> make_obcallback(): could not call init.
> [Fri Oct  6 17:36:09 2006] [error] [client]  
> python_handler: make_obcallback
> returned no obCallBack!
> I think that mod_python can't find files in the directory  '/home/ 
> glar/project/python/lib/python2.4/site-package/mod_python', I tried  
> to add it
> to the PythonPath directive in the httpd.conf and create PYTHONHOME  
> variable, no
> effect  :(
> What is wrong in my actions?

Your --with-apache option to mod_python config is a bit suspect, the
--with-apxs option I thought would have been sufficient.

Also, rather than use --with-python, try ensuring your PATH has the
bin directory containing your own python binary in the search path
first and it will be found that way.

Finally, also make sure that when you start your instance of Apache,
that your PATH again has the bin directory of your own python binary
in the search path first, else it will try and find the system one  
and use
it by mistake and not find the installed mod_python files.

As Jorey pointed out, it would be a good idea to ditch Apache 1.3.
Even if you can get it working, the mod_python that works with it (2.7)
has lots of problems and we will not be able to help you with it, as
most of the time our answer will be to upgrade.


More information about the Mod_python mailing list