lua-users home
lua-l archive

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

What's your lighttpd.config? You were looking at ?

FastCGI reduces the per-request invocation overhead to below 1ms as everything remains in memory, as compared CGI which has the latency of your disk + loading Lua for each request (especially on a VPS this can be bad). A significant difference for sites needing high-performance.

It's been a while since I used the Kepler FastCGI interface simply as above, but I recall having issues with failing to capture the URL that WSAPI uses to determine what file (app) to load (might have been a missing environment variable that I had to add to fastcgi.servers).

I only use clean/generic URL mappings as opposed file system based mapping (e.g. .lua), so I have url.rewrite for a single FastCGI app, that then parses the URL to perform its own routing. Depends how complex your app is and how many URLs you'll handle, but you probably also want to avoid having lots of separate FastCGI apps, and instead have multiple FastCGI 'servers' for a single app to better manage load.

On 5 Aug 2013, at 03:37, Henrique Gogó <> wrote:

> 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ó