Help required with mod_python and apache virtual hosts

Michael Fuhr mfuhr at fuhr.org
Fri Oct 1 20:02:41 EDT 2004


andy <andy at wild-flower.co.uk> writes:

> On Fri, 2004-10-01 at 03:53, Michael Fuhr wrote:
> > andy <andy at wild-flower.co.uk> writes:
> > 
> > > I'm trying to get mod_python working on my web server, but I'm running
> > > into problems, possibly due to having virtual hosts configured.
> > 
> > What problems are you having?  What are you expecting to happen,
> > and what is actually happening?  If there are warning or error
> > messages, what are they?  What makes you think the problems might
> > be related to virtual hosts?
>
> Is it too simplistic to just say "it doesn't work" ?

Yes -- saying "it doesn't work" tells us nothing about what you've
done and what symptoms you're seeing.  Without more information we
have to guess and make assumptions, which can waste time by leading
us down the wrong path.

Here's a good article on how to ask questions:

http://www.catb.org/~esr/faqs/smart-questions.html

"It is the questions asked, not the answers given, that distinguish
the wise person from the fool."  -Elie Wiesel

> As I said, Apache is not one of my areas of expertise (yet!).  I
> have tried to configure it according to the pycon 2004 "Introduction
> to mod_python" paper's examples, but as the httpd.conf file is
> arranged as a common part and then "includes" config files for each
> virtual host, I'm not sure I've done it right.  First, I tried to
> configure it so I can put the python scripts anywhere in the
> web-servers httpdoc tree, but that didn't work, so I have now tried
> customising one of the include files, but that doesn't work either.

What configuration directives did you use and where did you put
them?  If the directives are inside a block such as <VirtualHost>
or <Directory>, then post the entire block.

> This configuration scheme is dictated by my hosting company, and
> whereas I *could* change it, I'd lose all hope of support should I
> need it ;-) and the automated admin tool might stop working, too.
> I can get away with altering parts of it, but not a wholesale
> re-write (not that I'm capable of this anyway).

Tell us what you're altering from the working configuration.

Have you brought this issue up with the hosting company?  If they're
not able to help then perhaps you should find another provider, one
with more technical expertise.

> Here's the error I get in the browser:
>
> """
> Object not found!

Do you have access to the web server's error logs?  That's where
you're more likely to see meaningful diagnostics.

> The file in question *is* available, and readable by Apache (I've proven
> this by simply renaming it with .html on the end - as expected, the
> browser just shows the python source).

That's one problem we can rule out (the kind of problem that we'd
have had to ask about if you hadn't told us).  What name does the
file usually have, the name that results in "Object not found"?
What, if anything, appears in the web server's error logs when you
request that object?  Can you run the python script successfully
from the command line on the web server?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



More information about the Python-list mailing list