zero-config CGI enabled web server

Posted by halp on Server Fault See other posts from Server Fault or by halp
Published on 2010-06-06T17:18:54Z Indexed on 2010/06/06 17:23 UTC
Read the original article Hit count: 464

Filed under:
|
|
|
|

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.

© Server Fault or respective owner

Related posts about server

Related posts about http