I'm trying to implement a very simple http server with cgi functionality.
The code is simple:
import CGIHTTPServer, BaseHTTPServer
httpd = BaseHTTPServer. HTTPServer(('', 8000),
CGIHTTPServer.C GIHTTPRequestHa ndler)
httpd.serve_for ever()
I've created a subdir 'cgi-bin' which contains a python script. Now when I
enter this directory, i.e., go to the url http://localhost:8000/cgi-bin/ my
browser shows:
Error response
Error code 403.
Message: CGI script is not a plain file ('/cgi-bin/').
Error code explanation: 403 = Request forbidden -- authorization will not
help.
Plain html pages are ok.
It seems I misunderstand something very basical. Could somebody help me
please.
Thank you in advance.
The code is simple:
import CGIHTTPServer, BaseHTTPServer
httpd = BaseHTTPServer. HTTPServer(('', 8000),
CGIHTTPServer.C GIHTTPRequestHa ndler)
httpd.serve_for ever()
I've created a subdir 'cgi-bin' which contains a python script. Now when I
enter this directory, i.e., go to the url http://localhost:8000/cgi-bin/ my
browser shows:
Error response
Error code 403.
Message: CGI script is not a plain file ('/cgi-bin/').
Error code explanation: 403 = Request forbidden -- authorization will not
help.
Plain html pages are ok.
It seems I misunderstand something very basical. Could somebody help me
please.
Thank you in advance.
Comment