If you are a web.py / lighttpd newbie like me, this app might be useful.
It helps you figure out what's inside ctx and ctx.env at your specific deployment (i.e. the kind of server[s] you use and the way everything is configured).
It also displays some "lighttpd.conf wisdom" I've picked up during my short experience with lighty, but the app itself might be useful for other kinds of deployment if you try to figure out how exactly your environment appears from the web.py app's point of view.
"Out of the box" it runs a stand-alone http server.
As soon as you configure your apache/lighttpd/etc. as needed, uncomment a single line to go fastcgi
Enjoy
Jump to example output
Example output:
Fun and games at /a/<sneaky>&tricky/url
[Home]
query
style: '<b>'
so: 'on'
ctx
status: '200 OK'
homedomain: 'http://localhost'
ip: '127.0.0.1'
fullpath: '/funng/a/%3Csneaky%3E&tricky/url?style=%3Cb%3E&so=on'
headers: []
host: 'localhost'
home: 'http://localhost/test1'
homepath: '/test1'
path: '/funng/a/%3Csneaky%3E&tricky/url'
query: '?style=%3Cb%3E&so=on'
method: 'GET'
env
wsgi.multiprocess: False
HTTP_REFERER: 'http://localhost/test1/'
REDIRECT_STATUS: '200'
SERVER_SOFTWARE: 'lighttpd/1.4.13'
SCRIPT_NAME: '/test1'
REQUEST_METHOD: 'GET'
PATH_INFO: '/funng/a/<sneaky>&tricky/url'
SERVER_PROTOCOL: 'HTTP/1.1'
QUERY_STRING: 'style=%3Cb%3E&so=on'
HTTP_ACCEPT_CHARSET: 'UTF-8,*'
HTTP_USER_AGENT: 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)'
HTTP_CONNECTION: 'keep-alive'
SERVER_NAME: 'localhost'
REMOTE_PORT: '2262'
wsgi.url_scheme: 'http'
SERVER_PORT: '80'
SERVER_ADDR: '127.0.0.1'
wsgi.input: <flup.server.fcgi_base.MultiplexedInputStream object at 0x8287d8c>
HTTP_HOST: 'localhost'
wsgi.multithread: True
REQUEST_URI: '/test1/funng/a/%3Csneaky%3E&tricky/url?style=%3Cb%3E&so=on'
HTTP_ACCEPT: 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5'
wsgi.version: (1, 0)
GATEWAY_INTERFACE: 'CGI/1.1'
wsgi.run_once: False
wsgi.errors: <flup.server.fcgi_base.OutputStream object at 0x82877ec>
REMOTE_ADDR: '127.0.0.1'
HTTP_ACCEPT_LANGUAGE: 'en,he;q=0.8,th;q=0.6,ar-jo;q=0.4,en-us;q=0.2'
HTTP_ACCEPT_ENCODING: 'gzip,deflate'
HTTP_KEEP_ALIVE: '300'