Es existiert ein Ordner mit einem .py File das einen CGI-fähigen HTTP-Server enthält:
Code: Alles auswählen
import os
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
srvraddr=("",8080)
cgisrv=HTTPServer(srvraddr,CGIHTTPRequestHandler)
cgisrv.serve_forever()
erscheint folgende Ausgabe
Code: Alles auswählen
* cgi-bin/
* httpd.py
Code: Alles auswählen
import os
print "Content-Type: text/html"
print
print "<H1>Hello World</H1>"
Code: Alles auswählen
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.
Danke für jede Hilfe
Edit (Leonidas): Codes in Tags gesetzt.