Jim Gallacher
jpg at jgassociates.ca
Mon May 8 12:01:36 EDT 2006
Deron Meranda wrote: > On 5/8/06, stefano cirilli <stefano.cirilli1 at virgilio.it> wrote: >> i'm trying to get my own http404 page, my configuration, in apache conf >> file(Apache 2.0.55, mod_python 3.2.8), looks like this: >> <Directory htdocs/users/http404> >> SetHandler mod_python >> PythonHandler mod_python.publisher >> </Directory> > > I'm not exactly sure what you're trying to do, but it looks like you're > writing your own static file handler. In which case I think it will be > best just to let Apache serve up your files rather than using mod_python. > (Not to mention the security flaws in your sample code). In addition to the security flaw I would not use pagebuffer = open(req.filename, 'r').read() in production for anything other than a small file, as the whole file will be read into memory. Much better to have Apache serve up the file as Deron suggests, or at least use req.sendfile(). Also, I'd suggest getting publisher working before attempting the other things you are trying. Getting the python code when you access pagenotf suggests something is amiss with your configuration. I often find when I get the python code in the response that the culprit is a typo in the Directory path. Jim
|