For an HTTP server which makes use of modern Emacs network process handling see Web Server which requires Emacs 24.3 or greater but has no other dependencies. Web-server supports the full range of HTTP GET and POST requests, and web sockets. The info manual including usage examples is available online at manual.
The async approach has several benefits:
Below are two older approaches.
JohnWiegley posted version 1.0 as:
httpd.el is an HTTP server embedded in the Emacs. It supports GET and HEAD requests for static and dynamic content. (supporting POST should be easy by stealing code from CommonGatewayInterface above).
Note the following if you use Emacs version 21.4 or lower: Since Emacs doesn’t support server sockets, you need to cheat a little and run it from a service such as tcpserver or inetd. You can get better performance by running a proxy server which forwards requests to a persistent emacs instance using gnuserv; see the commentary for details. Version 0.4, 2001-05-17 under GNU GPL.
The first one above does not work for emacs23, and the second one redirects to a blank page.
Here’s one that I am using now - http://nullprogram.com/blog/2009/05/17/