mike watkins dot ca : October 22 2008 Archives

October 22 2008

QP, lighttpd, SSL and SCGI

A version of QP supporting Python 3.0 (and prior Python versions of course) will be released when Python 3.0 soon hits the streets. While doing some testing I created a lighttpd configuration example illustrating setting up a virtual host with SCGI (QP provides http and scgi servers natively) and SSL support:

QP with lighttpd

lighttpd is a lightweight web server that includes support for both SCGI and SSL. As noted in the Apache configuration example regarding "https_address" and "as_http_address", the same caveats apply. If you find it necessary to create a SSL "pemfile":

$ cat server.key server.crt > server.pem

The following are the minimum lighttpd.conf customizations required to enable SCGI and set up a virtual host for http and https:

server.modules = ("mod_access",
                  "mod_scgi",
                  "mod_accesslog")

$HTTP["host"] == "www.example.com" {
    $SERVER["socket"] == "0:443" {
        ssl.engine = "enable"
        ssl.pemfile = "/my/ssl/server.pem"
        ssl.ca-file = "/my/ssl/server.crt"
    }
    scgi.server = ( "" =>
        ( "localhost" =>
            ( "host" => "127.0.0.1",
              "port" => 9000,
              "check-local" => "disable",
              # default disable-time is 60 seconds
              "disable-time" => 5 # seconds
            )
        )
    )
}

Update

Wednesday November 12: After noting a post by Eric Mortiz I put together a set of results comparing both Apache and lighttpd proxy and SCGI front ends to a QP web / SCGI server. My results seem different than Eric's:

==================================================
QP web server direct    2.38 [ms] (mean)
lighttpd 1.4.20
lighttpd proxy to QP    2.41 [ms] (mean)
lighttpd SCGI           2.31 [ms] (mean)

APACHE 1.3.41
APACHE 1.3 proxy to QP  3.39 [ms] (mean)
APACHE 1.3 mod_scgi     2.30 [ms] (mean)
==================================================

Details in the attached file

From A Soldier's Perspective

Here is a video series depicting a day in the life of a company of soldiers which is unlike anything you'll see on the nightly news. No gore--you never see the "enemy" the soldiers are fighting. There's also not much editorializing done within the series - viewers will come to their own conclusions.

INSIDE AFGHANISTAN WITH BEN ANDERSON

I'm left with an impression of the randomness in daily outcomes and the ultimate futility in fighting forces which so casually can say "we'll fight forever" and actually mean it and deliver.

A tip of the hat to The Daily Digest

Update: View Part 7 of the video series, and then with that new perspective, read today's news - ‘Mistaken Identity’ Cited in 9 Afghan Deaths (Oct. 22, The New York Times)