HOME

httpserver

httpserver is a simple UNIX HTTP server implementing most of the features of HTTP 1.0 standard. It's written in C and was tested on Linux, Solaris.

Requests are handled by threads (libpthread used) to the maximum count defined in the configuration. CGI scripts are not supported currently.

Download

Configuration

The server can be configured in httpserver.conf file.

DOC_ROOT             HTTP server root directory (e.g. /home/michal/www)
CGI_BIN_DIR          subdirectory of DOC_ROOT, where CGI scripts will be run (not yet implemented)
PORT                 server port (e.g. 80 or 1825)
MAX_CONNECTIONS      maximal count of threads that are handling requests
SERVER_SOFTWARE      server description
SERVER_ADMIN         server admins's email address 
DEFAULT_TYPE         default Content-Type (e.g. 'text/plain')
LOG_FILE             log file
MAX_PENDING_CONNECTIONS     number of clients waiting in a queue (backlog parameter of listen())

Running

Screenshots & Log

Sample page retrieved from httpserver:

httpserver

Part of a log file:

09-29-06 11:20:06|GET /personal/index.html HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
09-29-06 11:20:06|GET /personal/style.css HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
09-29-06 11:20:06|GET /personal/img/mkrss-gtk.png HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
09-29-06 11:20:06|GET /favicon.ico HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
09-29-06 12:01:35|GET /programs/mkrss.html HTTP/1.0|localhost.localdomain|Wget/1.10.2
09-29-06 12:02:40|GET /programs/mkrss.html HTTP/1.0|localhost.localdomain|Wget/1.10.2
09-29-06 11:20:16|GET /personal/index.html HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
09-29-06 11:20:16|GET /personal/style.css HTTP/1.1|localhost.localdomain|Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7