Newbie Question!

Steve Holden sholden at holdenweb.com
Tue Aug 7 14:41:12 EDT 2001


----- Original Message -----
From: <fleet at teachout.org>
To: "Steve Holden" <sholden at holdenweb.com>
Cc: <python-list at cwi.nl>
Sent: Tuesday, August 07, 2001 2:26 PM
Subject: Re: Newbie Question!


> On Tue, 7 Aug 2001, Steve Holden wrote:
>
>
> > > [/home/dev/cbamc]$ python cgiserver.py
> > > localhost.localdomain - - [07/Aug/2001 11:32:26] code 403, message
> > Directory listing not
> > > supported
> > > localhost.localdomain - - [07/Aug/2001 11:32:26] "GET / HTTP/1.0"
> > 403 -
> > > Traceback (innermost last):
> > >   File "cgiserver.py", line 5, in ?
> > >     httpd.serve_forever()
> > >   File "/usr/lib/python1.5/SocketServer.py", line 195, in
> > serve_forever
> > >     self.handle_request()
> > >   File "/usr/lib/python1.5/SocketServer.py", line 210, in
> > handle_request
> > >     request, client_address = self.get_request()
> > >   File "/usr/lib/python1.5/SocketServer.py", line 223, in
get_request
> > >     return self.socket.accept()
> > > KeyboardInterrupt <---- me getting out
> > >
> > > The directory contains only 'index.html' (rather lengthy) and
> > 'cgiserver.py.'
> > >
> >
> > Seems like it might be a versioning problem, if indeed there really
is
> > anything wrong at all. From the traceback, it looks like your server
was
> > sitting there waiting to accept a request. I'm guessing you didn't
use
> > the right URL in your browser! In which case see below for the right
> > one...
>
> What I see in the browser when I go to :8000 is:
>
> Error response Error code 403.
> Message: Directory listing not supported.
> Error code explanation: 403 = Request forbidden -- authorization will
not help.
>
> > It works fine for me under Python 2.0 on Windows 98, for example:
>
> I'm using RH 7.0 (forgot to mention that).
>
> > it's rather a long time since I used it. If you don't like putting a
> > port number in your URLs, just change "8000" to "80" in the server
code.
>
> Changing to port 80, I get a "Test Page" that says Apache is installed
> correctly and (as administrator) I may now add content to this page.
>
The only way you should be getting a 403 is if there is no index.html
page to spew out. It indicates that the server thinks it should show you
a "table of contents", but it isn't able to do so for some reason. If I
delete *my* index.html I actually get a directory listing, so you need
to check your permissions carefully. Either the server can't read the
directory, or it can't read index.html, or both, I'm thinking.

When I suggested you move to port 80, I actualy meant move the server
;-) Since you appear to have an Apache server on port 80 this would not
be a good idea, so I would continue to use port 8000.

It really doesn't look like this is a Python problem. Maybe some other
reader can suggest what might be going wrong?

i'll-have-to-modify-that-web-page-ly y'rs  - steve
-
http://www.holdenweb.com/








More information about the Python-list mailing list