lua-users home
lua-l archive

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


On 17/10/2011 02:38, Luciano de Souza wrote:
What is the simplest way to run a Lua script in Apache producing web pages? I am not an
experienced developer, I don't want to invest now in very complex APIs. If I want only to
be able to show some HTML pages, process forms and query a database, is there really a
simple and well documented way to do it with Lua?

A long, long time ago, in a far away galaxy, er, no, but that's old, for sure, I plugged a Lua script into IIS (Internet Information Services, Microsof's Web server, which we used at work at the time). It was quite simple, and I was able to interpret queries and server pages with pure Lua.
The code is:
http://bazaar.launchpad.net/~philho/+junk/Lua/view/head:/TestCGI.lua

Quite outdated (HTML 4? Lua 5.0! Entities...) but perhaps simple enough to learn a bit from it. I recommend, of course, to use more the robust libraries mentioned in this thread... :-) Well, I mentioned it just to say that indeed, if you can plug in a language able to manipulate stdin and stdout into a Web server, you are already able to write a dynamic site.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --