"Haserl is a small program that uses shell or Lua script to create cgi web scripts. It is intended for environments where PHP or ruby are too big.

It was written for Linux, but is known to run on FreeBSD. A typical use is to run cgi scripts in an embedded environment, using a small web server, such as mini-httpd, lighty, or the server built into busybox."

Using busybox httpd / inet

Inetd custom config:

#:httpd-start: test web interface
8088	stream	tcp	nowait	root	/var/media/ftp/uFlash/httpd/httpd-start	httpd-start	-i



export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin
export LD_LIBRARY_PATH=/mod/lib


cd "$homedir"
exec httpd "$@" -p 8088 -c "$config" -h "$homedir" -r "Freetz" 2>/dev/null

Allow execution:

chmod +x httpd-start

httpd.conf can be an empty file:

touch httpd.conf


#!/usr/bin/haserl --shell=lua
Content-Type: text/html; charset=UTF-8

<% for n,v in pairs(ENV) do print(n, v, '<br />') end %>

Allow execution:

chmod +x info.cgi


zuletzt geändert vor 6 Jahren Zuletzt geändert am 03.05.2011 13:22:04