mod_lisp for Lighttpd

This is a branch of mod_lisp for the Lighttpd server.  The original mod_lisp
(for Apache) has been written by Marc Battyani and based on the example module
from the Apache distribution, and various other modules.  mod_lisp-lighttpd is
based on modules provided with the Lighttpd source, primarily mod_proxy.

Versions of mod_lisp-lighttpd are numbered L.<M>.<N> to distinguish them from
the Apache branch.  The current version is L.0.5, which matches Lighttpd vv.
1.4.15 upto and including 1.4.35.

Obtaining the code

The source package of the current version is available at  There is a Darcs
repository at, as well as a
GitHub mirror at

Contents of the distribution  -  a patch for lighttpd-1.4.15/src/  -  a patch for lighttpd-1.4.18/src/  -  a patch for lighttpd-1.4.19/src/  -  a patch for lighttpd-1.4.23/src/  -  a patch for lighttpd-1.4.25/src/  -  a patch for lighttpd-1.4.31/src/  -  a patch for lighttpd-1.4.33/src/  -  a patch for lighttpd-1.4.34/src/  -  a patch for lighttpd-1.4.28/src/  -  a patch for lighttpd-1.4.34/src/
  mod_lisp.c                -  the module source
  mod_lisp.README           -  this notice


Lighttpd must be recompiled and reinstalled with mod_lisp added to its
source.  For this end, download and unpack lighttpd, e.g. from (where M is the
minor version), and then continue as follows (I presuppose a Unix-like

1. Copy mod_lisp.c and to lighttpd-1.4.M/src.
2. Chdir to lighttpd-1.4.M/src and apply the patch by running 
   ``patch <''.  (If there is no patch for your
   version of Lighttpd, use the patch with the greatest version number
   not exceeding the version of Lighttpd.)  
3. Build and install Lighttpd as described in the INSTALL file for that
4. If you are using a distribution of Lighttpd where automake is run in
   the course of installation to re-generate (e. g., this
   is the case with FreeBSD ports) you should also patch
   with the


mod_lisp-lighttpd is configured via the Lighttpd configuration file which
can ordinarily be found at /usr/local/etc/lighttpd/lighttpd.conf,
/etc/lighttpd/lighttpd.conf, or some similar location.  Please refer to for the general description of the
file's syntax and semantics.  To make Lighttpd load mod_lisp, include
the string "mod_lisp" in the list server.modules, e.g.:

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

Options for mod_lisp are pretty straightforward:

  ## The port on which a Lisp listens for incoming connections
  lisp.server-port    = <int>        # default: 3000

  ## The IP address for the Lisp
  lisp.server-ip      = <string>     # default: ""

  ## The server-id string sent to the Lisp
  lisp.server-id      = <string>     # default: "lighttpd"

  ## How much diagnostic data written to Lighttpd error log. This tries to
  ## reproduce Apache's ap_log_error interface:
  ## LOGLEVEL_EMERG   = 0            : system is unusable
  ## LOGLEVEL_ALERT   = 1            : action must be taken immediately
  ## LOGLEVEL_CRIT    = 2            : critical conditions
  ## LOGLEVEL_ERR     = 3            : error conditions
  ## LOGLEVEL_WARNING = 4            : warning conditions
  ## LOGLEVEL_NOTICE  = 5            : normal but significant condition
  ## LOGLEVEL_INFO    = 6            : informational
  ## LOGLEVEL_DEBUG   = 7            : debug-level messages
  lisp.log-level      = <int>        # default: 4

  ## Whether requests should be handled by mod_lisp
  lisp.use-handler    = <bool>       # default: "disable"

  ## Max. number of sockets which may be opened to all Lisp servers
  lisp.max-sockets    = <int>        # default: 1024

These options are used most effectively in conjunction with conditional
sessions, e.g.:

  lisp.server-id      = "red-spiders"
  lisp.log-level      = 5
  lisp.max-sockets    = 128

  ## Forward requests to an UnCommon Web server on localhost:
  $HTTP["url"] =~ "\.ucw([/?]|$)" {
    lisp.use-handler  = "enable"
    lisp.server-ip    = ""
    lisp.log-level    = 7

  ## Forward requests with a different hostname to a remote server:
  $HTTP["host"] =~ "" {
    lisp.use-handler = "enable"
    lisp.server-ip   = ""
    lisp.log-level   = 0  # we don't meddle in government affairs


mod_lisp-lighttpd has been phased out and is no longer actively
maintained. The advisable way to expose your Lisp applications to
Lighttpd is by using a modern Web server Lisp-side (as of the time
of this writing, Sept. 2015, the available options include at least
Woo, TPD2 and Hunchentoot) and mod_proxy Lighty-side. If you're
still using a mod_lisp-based solution and need this program, or
want a bug fixed that you've discovered in a legacy installation,
address your reports to the maintainer, Boris Smilga, at
boris.smilga (at) gmail (dot) com.

Known Issues

The mod_lisp handler function may receive unexpected I/O events when
serving HTTPS requests (tested under FreeBSD and Linux with Lighty
1.4.35).  In versions prior to L.0.5 this would cause infinite
looping; L.0.5 fixes the looping by breaking off the connection to the
Lisp side, but still this makes mod_lisp an unreliable link.  The
origin of the problem hasn't yet been established.


This work is distributed under a FreeBSD style license (contact the
maintainer if you want another license).  Various portions of code are due
to Marc Battyani, Jan Kneschke and Boris Smilga, as specified in the
copyright notice in the source file.  The Apache licence has been retained
for legacy reasons, although ostensibly no Apache code is left in the