lua-users home
lua-l archive

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

And any solution for my FastCGI problem?

Thanks for explanation about CGI.

2013/8/5 Coda Highland <>
The problem with CGI is that it involves restarting the application
for every page request. This means reloading the Lua script from disk
and performing all of the startup initialization with each request,
which can add up to a substantial amount of overhead. It also means
there's no in-memory persistence between requests, so you've got to
persist session data to disk (or at least to shared memory) and reload
it every request as well.

All of CGI's successors sidestep this problem.

/s/ Adam

On Sun, Aug 4, 2013 at 7:55 PM, Henrique Gogó <> wrote:
> One solution that I found was use simple cgi configuration on lighttpd.
> No cgilua, no fastcgi, no dependencies, just enabled cgi module in lighttpd
> and added:
> cgi.assign = (
> ".lua"  => "/usr/bin/lua",
> )
> But I've been read that cgi is too slow, and FastCGI is better.
> "Pure cgi" is too bad to use? I think so simple and fast to configure that
> I'm thinking use this approach to start my web application.
> Any suggestions?
> 2013/8/4 Henrique Gogó <>
>> Hello World!
>> I'm trying to configure a webserver to use Lua to create web applications.
>> I use lighttpd as my default webserver to run static websites and PHP
>> blogs, so, my obvious choice was lighttpd.
>> Searching in Google and in this list history, I see that would be easy to
>> configure, in fast steps, that I follow:
>> - Install cgilua with luarocks
>> - Install wsapi and wsapi-fcgi with luarocks as dependence
>> - Configure few lines in lighttpd.conf
>> - Restart lighttpd
>> When I did this, lighttpd stop to serve my websites.
>> Then I run cgilua.fcgi in terminal, and always I receive this error
>> message:
>> WSAPI error in application: /usr/local/share/lua/5.1/wsapi/common.lua:408:
>> could not find a filename to load, check your configuration or URL
>> stack traceback:
>> [C]: in function 'error'
>> /usr/local/share/lua/5.1/wsapi/common.lua:408: in function
>> 'adjust_non_wrapped'
>> /usr/local/share/lua/5.1/wsapi/common.lua:422: in function
>> 'normalize_paths'
>> /usr/local/share/lua/5.1/wsapi/common.lua:665: in function
>> </usr/local/share/lua/5.1/wsapi/common.lua:663>
>> (tail call): ?
>> [C]: in function 'xpcall'
>> /usr/local/share/lua/5.1/wsapi/common.lua:257: in function 'run_app'
>> /usr/local/share/lua/5.1/wsapi/common.lua:284: in function 'run'
>> /usr/local/share/lua/5.1/wsapi/fastcgi.lua:40: in function 'run'
>> in main chunk
>> [C]: ?
>> Anybody can help me? What I'm doing wrong?
>> Thank you
>> --
>> Henrique Gogó
> --
> Henrique Gogó

Henrique Gogó