lua-users home
lua-l archive

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



Am 04.01.2014 14:58, schrieb Peng Zhicheng:
于 2014-1-3 21:25, Gilles Ganault 写道:
On Sun, 08 Dec 2013 00:46:30 +0100, Gilles Ganault
<gilles.ganault@free.fr> wrote:
I'm running Debian and Nginx on a Linux appliance, and would like to
use Lua for form validation to avoid the fat of PHP or Python.
I'm still not clear about what I should use to run basic web scripts
in Lua through Nginx.

Am I correct those are the options available?

1. Nginx + Lua
"You can install it from source by compiling the lua-nginx-module with
your existing Nginx. If you chose that path you will also need a Lua
interpreter. LuaJIT-2.0.0 is recommended."
http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-lua
2. CGI
3. FastCGI
4. uWSGI
5. ngx_lua module (a.k.a. HttpLuaModule)

Which solution would you recommend, preferably without having to
recompile Nginx since this is for an ARM appliance?

Thank you.



I found the announcement of this very interesting and useful project[1][2],
which you might probably want to give it a try.

It is very tiny and _just wokrs_ out of the box. There is even a interactive
DIY tutorial[3] you can download and use, simple and easy to explore.
It also supports a server side script format called `Lua Server Page',
or lsp[4], which has a very similar syntax to the `Lua Pages'[5] of CGILua.

A simple lsp page looks like this (quoted from the makoserver website)

--------------------cut-----------------------
<?lsp local message="Hello World" ?>
<html>
  <body>
    <h1><?lsp=message?></h1>
  </body>
</html>
--------------------cut-----------------------


FWIW, I am using nginx with the FastCGI module I put on github.com/mbalmer.