Date: Tue, 10 Aug 2004 23:46:31 -0700 (PDT) From: Suhaimi Jamalludin <suhaimi_sj@yahoo.com> To: freebsd-questions@freebsd.org Subject: mod_python testing using mptest.py failed on FreeBSD5.2.1 Message-ID: <20040811064631.44267.qmail@web53409.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi All, Need your advice on mod_python. I'm running FreeBSD5.2.1, apache+mod_ssl-1.3.31+2.8.19 and mod_python-2.7.10. I have done the configuration seting on http.conf and restart my apache. Apache runing fine, however during my mod_python testing I got this error in my httpd-error.log. Error Message: make_obcallback(): could not import mod_python.apache. make_obcallback(): could not call init. [Tue Aug 10 11:57:32 2004] [error] [client 10.1.4.118] python_handler: make_obcallback returned no obCallBack! Can somebody advice me please. Appreciate your help. regards, suhaimi My step-by-step for mod_python on FreeBSD5.2.1 ----------------------------------------------------- 1) Installed python # cd /usr/ports/lang/python # make -DWITHOUT_THREADS install clean 2) Installed mod_python # cd /usr/ports/www/mod_python # make -DWANT_EAPI install clean 3) Modify apache configuration file #vi /usr/local/etc/apache/http.conf add below line at the end of the http.conf ----snip----- <Directory /usr/local/www/cgi-bin/modpython> AddHandler python-program .py PythonHandler mptest PythonDebug On </Directory> ----snap----- 4) Create mptest.py # vi /usr/local/www/cgi-bin/modpython/mptest.py add below line in mptest.py ----snip----- from mod_python import apache def handler(req): req.write("Hello World!") return apache.OK ----snap----- 5) Restart Apache # /usr/local/etc/rc.d/apache restart 6) Open Mozilla Web Browser type the mod_python test file as below. http://10.1.4.8/cgi-bin/modpython/mptest.py Browser output: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@local.domain and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. 7) Check apache log file # tail /var/log/httpd-error.log [Tue Aug 10 11:57:24 2004] [notice] caught SIGTERM, shutting down [Tue Aug 10 11:57:28 2004] [notice] Apache configured -- resuming normal operations [Tue Aug 10 11:57:28 2004] [notice] Accept mutex: flock (Default: flock) 'import site' failed; use -v for traceback make_obcallback(): could not import mod_python.apache. make_obcallback(): could not call init. [Tue Aug 10 11:57:32 2004] [error] [client 10.1.4.118] python_handler: make_obcallback returned no obCallBack! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040811064631.44267.qmail>