[mod_python] mod_chroot & mod_python problem

Graham Dumpleton grahamd at dscpl.com.au
Mon Feb 7 05:22:47 EST 2005


Can you possibly run Apache manually yourself within the context of the 
chroot jail?

In the code prior to that point, it does:

     if (! ((m = PyImport_ImportModule(MODULENAME)))) {
         fprintf(stderr, "make_obcallback(): could not import %s.\n", 
MODULENAME);
     }

     if (! ((obCallBack = PyObject_CallMethod(m, INITFUNC, NULL)))) {
         fprintf(stderr, "make_obcallback(): could not call %s.\n",
                 INITFUNC);
     }

The problem is these print to stderr and not to the log and you 
wouldn't see the
error messages. If you can run httpd manually, maybe you can then see 
stderr.

Alternatively, you could change the code to use the log file instead. 
In mod_python
3.1.3 it has:

     if (! ((m = PyImport_ImportModule(MODULENAME)))) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, s,
                      "make_obcallback: could not import %s.\n", 
MODULENAME);
         PyErr_Print();
     }

     if (m && ! ((obCallBack = PyObject_CallMethod(m, INITFUNC, NULL)))) 
{
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, s,
                      "make_obcallback: could not call %s.\n", INITFUNC);
         PyErr_Print();
     }

This will at least give you a little bit more information.

One could speculate though that there isn't a Python distribution 
accessible within
the chroot jail, or if there is, then mod_python isn't installed into 
it.

Graham

On 07/02/2005, at 8:36 PM, John wrote:

> Hello all
>  
> I am using Apache/1.3.28 (Linux/SuSE) mod_python/2.7.10 Python/2.3+ 
> PHP/4.3.3 mod_ssl/2.8.15 OpenSSL/0.9.7b mod_chroot 0.4
>  
> mod_python works outside the chroot jail but when i jail the apache i 
> receive that error in my logs
>  
> python_handler: make_obcallback returned no obCallBack!
>  
> Does anyone know why this happen?
> _______________________________________________
> 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