I am trying to configure Python CGIHTTPServer on Mac OS X to be able to serve CGI scripts locally, but I seem to be unable to do this.
I have a simple test script:
It has permissions -rwxr-xr-x@ and is located in ~/WWW (with permissions drwxr-xr-x ). It works fine with the shell, and for this I use a script using the CGIHTTPServer :
import CGIHTTPServer import BaseHTTPServer class Handler(CGIHTTPServer.CGIHTTPRequestHandler): cgi_directories = ["~/WWW"] PORT = 8000 httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler) print "serving at port", PORT
But when I run it, the transition to localhost:8000 just serves for the contents of the script, and not for the result (i.e. returns code, not output).
What am I doing wrong?
source share