4.9.4 Stand-alone Python HTTP Server Deployment

##
4.9.4 Stand-alone Python HTTP Server Deployment

The standard Python libraries provide a pure-Python HTTP server in the `BaseHTTPServer` module. Code contributed by Matt Goodall allows you to deploy your Albatross applications as stand-alone scripts using this module to service HTTP requests.

Unlike the other `Request` classes, applications deployed via the stand-alone Python HTTP server do not require you to instantiate the `Request` class directly. Instead, the `al-httpd` script imports your application (specifically, the script that instantiates the application object), and starts the HTTP server.

Currently, applications deployed via the stand-alone http server are single threaded, meaning that other requests are blocked while the current request is being serviced. In many cases this is not a problem as the requests are handled quickly, but if your application takes a significant amount of time to generate it's results, you may want to consider other deployment options for production use.

The stand-alone http server makes it particularly easy to deploy Albatross applications, and is a great way to debug applications without the complications that `mod_python` and `FastCGI` necessarily entail.

Most of the Albatross samples can be run under the stand-alone server:

    $ cd samples/tree2
    $ al-httpd tree.app 8080 /alsamp/images ../images/