lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> I've had a look at Kepler, CGILua and WSAPI, but none of them explains
> how to run simple Lua cgi applications from Apache.

Here is the method I prefer, using WSAPI with request and response objects:

#! /bin/bash /path/to/kepler/bin/wsapi.cgi
return function (env)
  local request =
  local response =
  for k,v in pairs(request.GET) do
     response:write(k.." = "..tostring(v).."<br/>")
  return response:finish()

Put this into hello.cgi in where you would put other CGI files, set
the standard CGI permissions and access it like any CGI file.  The
fact that the body of the script is wrapped in a function may be a
hassle for simple CGI, but the plus is that it allows you to use the
exact same script with Xavante (just rename it and put it in

- yuri