Your web server's CGI support seems broken... do you have a documentation page for it?
-- Fabio Mascarenhas On Mon, Dec 6, 2010 at 11:28 PM, McClure, Timothy J UTCFS <tim.mccl...@fs.utc.com> wrote: > I am trying to run the example hello.lua script over mini-httpd. When I run > the hello.lua directly from the command line it works but the environment > variables that would be set by wsapi are understandably nil. The > environments variables are still nil when I run hello.lua through the > browser giving me the following error: > > /usr/share/lua/5.1/wsapi/common.lua:189: bad argument #1 to 'match' (string > expected, got nil) > > stack traceback: > > [C]: in function 'match' > > /usr/share/lua/5.1/wsapi/common.lua:189: in function 'splitext' > > /usr/share/lua/5.1/wsapi/common.lua:204: in function > > (tail call): ? > > /usr/bin/wsapi.cgi:16: in function > > (tail call): ? > > [C]: in function 'xpcall' > > /usr/share/lua/5.1/wsapi/common.lua:147: in function 'run_app' > > /usr/share/lua/5.1/wsapi/common.lua:171: in function 'run' > > /usr/share/lua/5.1/wsapi/cgi.lua:18: in function 'run' > > /usr/bin/wsapi.cgi:26: in main chunk > > [C]: ? > > > > I was informed in an earlier e-mail that all I need is e-mail support to run > cgilua. How do I get these environment variables set? > > > > The hello.lua code: > > #!/usr/bin/env wsapi.cgi > > > > module("hello", package.seeall) > > > > function run(wsapi_env) > > local headers = { ["Content-type"] = "text/html" } > > > > local function hello_text() > > coroutine.yield("<html><body>") > > coroutine.yield("<p>Hello Wsapi!</p>") > > coroutine.yield("<p>PATH_INFO: " .. wsapi_env.PATH_INFO .. "</p>") > > coroutine.yield("<p>SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "</p>") > > coroutine.yield("</body></html>") > > end > > > > return 200, headers, coroutine.wrap(hello_text) > > end > > > > return _M > > > > Thx > > _______________________________________________ > Kepler-Project mailing list > Kepler-Project@lists.luaforge.net > http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project > http://www.keplerproject.org/ > _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/