[uWSGI] Newbie question about uwsgi/uWSGI + Lua

Gilles codecomplete at free.fr
Mon Apr 21 16:55:48 CEST 2014


On Thu, 16 Jan 2014 15:06:38 +0100, Gilles
<codecomplete at free.fr> wrote:
>Since the Nginx ngx_lua module is blocking and is, thus not
>recommended for use with SQLite, I need to know if uwsgi/uWSGI is a
>better alternative:

I read the uwsgi-docs.pdf but didn't find how to run uwsgi as an HTTP
server to support Lua scripts in CGI.

=============== Compiling uwsgi on ARM:

1. Compiled uwsgi:

UWSGICONFIG_LUAPC=luajit
make lua cgi

2. Wrote a configuration file:

;myapp.ini
[uwsgi]
workdir = /tmp/uwsgi-2.0.3
ipaddress = 192.168.0.10

http = $(ipaddress):8080
stats = $(ipaddress):9191
processes = 4
threads = 2
uid=nobody
gid=nogroup
static-index = index.html, index.htm
check-static=%(workdir)/www
http-modifier1=9 ;lua
cgi=%(workdir)/cgi
cgi-allowed-ext=.lua
cgi-helper=.lua=lua

3. Wrote a CGI script in Lua in /tmp/uwsgi-2.0.3/cgi
********
print("Status: 200 OK\n")
print("Content-Type: text/plain\n\n")

print("Yes!")
********

4. Launched uwsgi
./uwsgi myapp.ini

=============== Issues:

1. http://srv/  doesn't work: Looks like static-index above is wrong.
Should I use another separator than a comma?

2. http://srv/cgi/ = Not found

http://srv/cgi/test.lua = prints source code instead of running the
script. Is it because of http-modifier?

Thanks for any help.



More information about the uWSGI mailing list