lua-users home
lua-l archive

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


On Tue, 28 Jan 2014 10:46:29 -0200 (BRST), Tomas Guisasola Gorham
<tomas@tecgraf.puc-rio.br> wrote:
> 	Have you tried the examples in Haserl's man-page:
>
>http://haserl.sourceforge.net/manpage.html#lbAJ
>
> 	Anyway, if you are seeing the source code, it seems the
>interpreter (which should be /usr/bin/haserl) is not being called...
>Are you sure the configuration file you showed in the message was loaded
>by the server?

Thanks for the idea. Indeed, the following line in mini-httpd.conf was
wrong:
=================
#BAD?cgipat=**.cgi,**.lua
cgipat=**.lua
=================

Also, the script was missing the "content-type" line:
=================
#!/usr/bin/haserl --shell=lua
content-type: text/html

<% io.write ("Hello World" ) %>
=================

Without it, mini-httpd returns "Bad response. The server or forwarder
response doesn't look like HTTP."

Thanks all.