aptitude install nginx
The config in /etc/nginx is good in squeeze. We will need to add the
fastcgi handler, but that is to be expected. (I edited it to pull
the root up to /var/www instead of in an nginx-default
subdirectory.)

aptitude install liblua5.1-wsapi-fcgi-1
There is also a ‘0’ version, but I took 1 on the theory that newer
is better.

aptitude install liblua5.1-coxpcall0
liblua5.1-wsapi-fcgi-1 probably needs a dependency on this. Things
will go poorly for you without it.

aptitude install lua5.1
Can’t forget that.

aptitude install spawn-fcgi
Older instructions talk about libfastcgi-dev, but it isn’t available
and I think they just wanted spawn-fcgi out of it anyway.

spawn-fcgi -a 127.0.0.1 -p 9100 -F 4 -- /usr/bin/wsapi.fcgi
Now we have handlers on port 9100. This will need to be in
/etc/init.d/blahblahblah but this will do for now.Note: spawn-fcgi silently fails if you get the command wrong. Do
a “ps” and make sure they are there. You will have a section like
this if it succeeds…
18554 ? Ss 0:00 lua5.1 /usr/bin/wsapi.fcgi
18555 ? Ss 0:00 lua5.1 /usr/bin/wsapi.fcgi
18556 ? Ss 0:00 lua5.1 /usr/bin/wsapi.fcgi
18557 ? Ss 0:00 lua5.1 /usr/bin/wsapi.fcgi

Now my thoughts: This may be more than I wanted. I have to think about
the implications of a scrutinizer layer above my Lua program. I really
wanted to just blast my standard output back up the fastcgi socket. All
this yielding seems strange.

commentBy anonymous commenter,3 years ago
For anyone else who stumbles across this, I found a better solution: http://www.marmottus.net/blog/2012/03/25/nginx-and-lua/By anonymous commenter,3 years ago
Very strange indeed. I still don't understand why every Lua implementation (except for luasp.org) seems to be done backwards. Why doesn't anyone try to take the php approach and allow web designers to work on designing instead of doing strange script-fu just to use Lua?