473,382 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

mod_python and Internal Server Error ...

Hello,

I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the
publisher handler and the Clearsilver template engine, and from time to
time apache returns an 500 error code (Internal Server Error).
Apache errog.log file looks like :

[Tue Jun 28 14:42:12 2005] [error] [client 164.x.x.x] PythonHandler
mod_python.publisher: Traceback (most recent call last):
[Tue Jun 28 14:42:12 2005] [error] [client 164.x.x.x] PythonHandler
mod_python.publisher: File
"/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in
HandlerDispatch\n result = object(req)
[Tue Jun 28 14:42:12 2005] [error] [client 164.x.x.x] PythonHandler
mod_python.publisher: File
"/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 98, in
handler\n path=[path])
[Tue Jun 28 14:42:12 2005] [error] [client 164.x.x.x] PythonHandler
mod_python.publisher: File
"/usr/lib/python2.3/site-packages/mod_python/apache.py", line 454, in
import_module\n f, p, d = imp.find_module(parts[i], path)
[Tue Jun 28 14:42:12 2005] [error] [client 164.x.x.x] PythonHandler
mod_python.publisher: ImportError: No module named taxal

....

What is strange is that when I reload the page, it's displayed fine, but
from time to time I get 500 error code ... which is quite annoying ...

As I'm using the publisher handler, my index.py looks like :

import sys
import os.path
import neo_cgi
import neo_util
import neo_cs

from mod_python import util, apache
from psycopg import QuotedString

config = apache.import_module('config', autoreload = 0, log = 0)
utils = apache.import_module('utils', autoreload = 0, log = 0)
specimen = apache.import_module('specimen', autoreload = 0, log = 0)
taxon = apache.import_module('taxon', autoreload = 0, log = 0)
fulltextsearch = apache.import_module('fulltextsearch', autoreload = 0,
log = 0)

template_directory = config.getTemplateDirectory()
template_main = config.getTemplateMain()
template_menu = config.getTemplateMenu()

def index(req):
return home(req)

def home(req):
return _render(req, 'home')

def links(req):
return _render(req, 'links')

def contact(req):
return _render(req, 'contact')

def taxal(req):
sort = req.form.getfirst('sort')
order = req.form.getfirst('order')

tl = taxon.taxon()
tl.getTaxaList(sort, order)
hdf = tl.getHDF()
return _render(req, 'taxalist', hdf)

(...)

So for the above example if I GET http://b.abc.be/birds/taxal it should
run the "def taxal(req)" function ... I don't understand why I get a
"mod_python.publisher: ImportError: No module named taxal" error message
in the apache logfile.

We have several virtualhosts : a.abc.be, b.abc.be, c.abc.be, ...
(fictive addresses). Our www directory is organized like this :
/var/www/vhosts/a.abc.be/
/var/www/vhosts/b.abc.be/
/var/www/vhosts/b.abc.be/enbi/
/var/www/vhosts/b.abc.be/enbi/projects/birds/
/var/www/vhosts/b.abc.be/enbi/projects/butterfly/
/var/www/vhosts/b.abc.be/enbi/projects/rubiaceae/
/var/www/vhosts/c.abc.be/blah/

I've tried with "PythonInterpPerDirectory on" in my .htaccess, but
without success ...

In advance thanks for your support
Jul 19 '05 #1
0 1582

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nancy | last post by:
Hi, I am new to python. I am trying to install mod_python in my computer(WinXP Pro, Apache 2.0.50, python2.3.4). I added the following statements in my Apache configuration file httpd.conf ...
6
by: Piet | last post by:
Hi there, I cannot install mod_python v3.1.3 on either Win2k/ActivePython 2.3.2 or WinMe/Python 2.3.4. When I run the Windows installer, I get the following error message: Traceback (most recent...
3
by: Rune Hansen | last post by:
I've posted this question on the mod_python mailing list but didn't get much response, so I thought I'd post it here. (My first attempt connected to an unrelated thread..sorry....
0
by: Christopher | last post by:
I am running: Fedora Core 1 Python 2.4 Apache 1.3.3 mod_python 2.7.11 When I try to access the test mptest.py file I receive: > Internal Server Error
3
by: Mark | last post by:
Hi, I've just installed the Win32 build of mod_python 3.1.4 for Python 2.4 and have setup my Apache config file with the LoadModule and PythonHandler directives and then copied "mod_python.so" to...
2
by: Robert J. Hansen | last post by:
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered...
1
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req):...
4
by: John Salerno | last post by:
I get this internal error message when I try to access a PSP page: "Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module not included in the server configuration" So it...
1
by: boney | last post by:
hello All, I am totally unknown to python language.. i need to install mod_python to embed python interpreter with the Apache server, in order to use Trac with Apache Web Server i am using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.