How to detect the current web server programmatically?

See also: