Login or register Large RSS Icon

thttpd

It is straightforward to use the web server thttpd in conjunction with Kepler.

Background on thttpd

From the thttpd homepage:

thttpd is a simple, small, portable, fast, and secure HTTP server with the following characteristics:

  • Simple: It handles only the minimum necessary to implement HTTP/1.1. Well, maybe a little more than the minimum.
  • Small: It has a very small run-time size, since it does not fork and is very careful about memory allocation.
  • Portable: It compiles cleanly on most any Unix-like OS.
  • Fast: In typical use it's about as fast as the best full-featured servers (Apache, NCSA, Netscape). Under extreme load it's much faster.
  • Secure: It goes to great lengths to protect the web server machine against attacks and breakins from other sites.
  • It also has one extremely useful feature (URL-traffic-based throttling) that no other server currently has. Plus, it supports IPv6 out of the box, no patching required.

While all of these claims may no longer be entirely true in regards to comparisons with other web servers, its statements concerning thttpd directly are accurate.

thttpd with Kepler

To get thttpd working with the cgi launcher from Kepler 1.1, use the following steps as a guideline.

This setup was tested on a standard linux distribution

  • Install thttpd
  • Make sure that thttpd is not running in a chroot jail (effectively enabling CGI processing). See below for a sample thttpd configuration file.
  • Build kepler with the configure-time option of --launcher=cgi. Visit UNIX Installation for further details.
  • Copy the cgi file into the cgi-bin directory
  • Start producing *.lua and *.lp files, referencing them through the cgi redirect.

As an example, here is a sample config file and directory setup:

thttpd.conf

port=80
user=nobody
dir=/var/thttpd/www
nochroot
cgipat=/cgi-bin/**
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid

Sample directory structure

/usr/sbin/
          thttpd

/etc/
     thttpd.conf

/var/thttpd/www/
               status.lp
               cgi-bin/
                       cgi

Start thttpd along the lines with something like

/usr/sbin/thttpd -C /etc/thttpd.conf

Bring up in the web browser http://your.domain.name/cgi-bin/cgi/status.lp

This brings up the ability to run on some of these small embedded Linux devices like the Linksys NSLU-2 (affectionately known as the slug); they have a default customized version of thttpd running; it might be dead simple to get it extended using Kepler.

Additionally, one could investigate how to operate in a chroot jail, to really have a level of protection. There is documentation of running CGI inside chroot; I'm guessing that in addition to those steps, kepler would need to exist within that directory structure.

Powered by Sputnik | XHTML 1.1