0

To serve static content of a directory over http, one can simply navigate to that directory and type:

python -m SimpleHTTPServer 11111

which will start a http server on port 11111.

This hack is nice because it requires zero-config: no stand-alone web server, no config files at all.

Is it possible to extend this example, or have an alternate way to achieve this goal, but also have CGI support?

The final goal is to have a quick and lazy way of serving a web site from a certain directory. The site has static content (HTML pages, images), but also a CGI script. The CGI script must work properly when accessed via browser.

Of course I could setup a virtual host in apache, allow CGI inside it etc. But that's not a zero-config approach.

1 Answer 1

0

You mean like CGIHTTPServer?

1
  • Excellent! The only tweak I had to do was to create a cgi-bin subdirectory and move the cgi script there, to match the defaults of CGIHTTPServer.
    – halp
    Jun 7, 2010 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .