[Kepler-Project] Initial success with cgi and thttpd and addtional
comments
Keith Pimmel
pimmel at ieee.org
Mon Jan 29 13:19:37 BRST 2007
The following is to pollute the mailing list and archive for
posterity. Following up to my question from a few months back, I was
able to get the latest snapshot of kepler to work with thttpd. thttpd
is a small, simple, secure web server with some neat functionality
[1].
Steps taken (running on Zenwalk Linux, a slackware derivative):
* Install thttpd (I used the package from linuxpackage.net, but it
would be just as easy to compile yourself - very small software
package).
* Make sure that it is not running in a chroot jail (effectively
enabling CGI processing).
* Build kepler (my configure options were: > ./configure --enable-lua
--launcher=cgi
* Copy the cgi and cgi.lua files into the cgi-bin directory (just like
Tomas suggested [2] but I utterly failed to recognize in the mailing
archives).
* Start producing *.lua and *.lp files, referencing them through the
cgi redirect.
As an example, here is my 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:
,----------------------------------------
| /var/thttpd/www/
| status.lp
| cgi-bin/
| cgi
| cgi.lua
`----------------------------------------
Bring up in the web browser: http://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. I've seen evidence of people
running CGI inside chroot; I'm guessing that in addition to those
steps, kepler would need to exist within that directory structure.
Other comments: I played around with trying to get Kepler working with
other things as well. I saw in a previous message that someone was
trying to get Kepler's mod2 build to work with Apache 2.2.x, and I
don't think that Kepler currently supports Apache 2.2, but rather only
Apache 2.0.x. I ran into the same problems that the other poster did
trying to use 2.2, but had relative success with 2.0. Is this a valid
statement? And if so, you might want to specify that in your
documentation online (currently states Apache 2.x). I think I had some
other comments about directory structures, but I left my notes at
home. I'll try and verify the errors I saw and post them tonight.
Anyways, sorry for the long post. Thanks for opening up Lua to web
development, and I'm eagerly waiting for the additional Kepler modules
of LuaExpat and LuaSQL!
yrs,
Keith
[1] http://www.acme.com/software/thttpd
[2] http://lists.luaforge.net/pipermail/kepler-project/2006-November/000301.html
--
Keith Pimmel
More information about the Kepler-Project
mailing list