Help required with mod_python and apache virtual hosts

A

andy

Hi,

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.

I'm no apache guru (newbie is more accurate!) so I could easily be doing
something wrong. The apache configuration is further complicated by
having an include file for each virtual host, so the config isn't
actually *in* the main apache conf file!

I've read through several tutorials, but they all seem to deal with a
much simpler setup than I have. I *could* throw away the current config
and start again, but I'd inevitably break more than I fixed!

So, are there any mod_python experts out there willing to put up with
some daft questions?

I live in hope ;-)
-andyj
 
M

Michael Fuhr

andy said:
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?
 
A

andy

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?

Thanks for replying, Michael.

Is it too simplistic to just say "it doesn't work" ? 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. 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).

Here's the error I get in the browser:

"""
Object not found!

The requested URL was not found on this server. If you entered the URL
manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster

Error 404

www.fusionation.org
Thu 30 Sep 2004 11:03:23 PM BST
Apache/2.0.40 (Red Hat Linux)
"""

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).

I can't think of what else to check.

Hope that gives you something to go on...

regards,
-andyj
 
M

Michael Fuhr

andy said:
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>
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top