Compact web server with Lua support?
I need to find a very compact, cross-platform web server that can run Lua scripts, ie. either a regular web server like Mongoose that will forward queries to a Lua program in eg. FastCGI, or a web server itself written in Lua which will save the need to provide a s开发者_StackOverflow社区eparate web server.
I recently started learning about Lua so am still in the dark about what is available out there, save for the two I came across:
Xavante - Lua HTTP 1.1 Web server
Haserl
If someone's already done this recently, what solution would you recommend along with any tutorial/article that would get me started?
There's also a new project from Zed Shaw called mongrel2 that has Lua support via another project (also by Zed) called Tir, bound to mongrel2 via a ZeroMQ bus. (mongrel2.org, tir.mongrel2.org). It's not as mature as the Lua nginx project but it does provide for dedicated Lua processes and significant advantages for logical and physical separation of application components. Cool stuff.
Why not try Xavante, the Lua-oriented web server built by the Kepler project, which is run by many of the same people who brought us Lua?
Mongoose now supports Lua out of the box. If you're using windows, Lua support is pre-compiled in the binary. Checkout the example at https://raw.github.com/valenok/mongoose/master/examples/lua/dirscan.lp
There's also lighttpd.
I have not tried this myself, but there is a blog post about using Lua with nginx here.
A good and informative question btw, I hadn't heard of Haserl before :)
Nginx and Apache have both a Lua module, and Apache supports CGI. Try Ophal, a Lua web framework that runs on Nginx, Apache, Lighty and any other web server that supports CGI/FastCGI.
You can also take a look at G-WAN, which is very compact and ultra fast.
Try llserver - minimalistic Lua server. Runs as single coroutine, serves dynamic content via callback function: https://github.com/ncp1402/llserver
精彩评论