>
>> On Fri, 17 Jan 2014 07:32:22 +0100, "Roberto De Ioris"
>> <[email protected]> wrote:
>>>> I read this doc...
>>>>
>>>> http://uwsgi-docs.readthedocs.org/en/latest/Lua.html
>>>>
>>>> ... and would like to know how to run uwsgi to handle a whole site,
>>>> ie. serve static HTML files and only launch Lua scripts when needed
>>>> (eg. to handle forms, etc.).
>>>>
>>>> The example assumes the user only wants to use uwsgi to run a
>>>> Lua-based web application.
>>>
>>>Serving static files:
>>>
>>>http://uwsgi-docs.readthedocs.org/en/latest/StaticFiles.html
>>
>> Thanks for the links.
>>
>> I used the following to launch uwsgi:
>>  ./uwsgi --http :9090 --check-static ./www --uid nobody --gid nogroup
>> --master --processes 4 --threads 2
>>
>> ./www/index.html works OK, but I'm stuck at how to handle forms with a
>> Lua script:
>> =============== ./www/form.html
>> <form action="script.lua" method="POST">
>>         <input type="text" name="dummy">
>>         <input type="submit" value="Click me">
>> </form>
>> =============== ./www/script.lua
>> print("hello")
>>
>> -> "Internal Server Error"
>> ===============
>>
>> The documentation assumes that the user wishes to run a web
>> application instead of a single script:
>> http://uwsgi-docs.readthedocs.org/en/latest/Lua.html
>>
>> Can uwsgi run a simple Lua script to handle intput from forms?
>>
>> Thank you.
>>
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>
>
> i suppose you are referring to cgi mode.
>
> Be sure to build a uWSGI binary with cgi support (make cgi) or to load the
> cgi plugin in your binary, then you can map extensions/uri/paths to
> scripts
>
> For example:
>
> [uwsgi]
> ...
> cgi = /var/www
> cgi-allowed-ext = .lua
> cgi-helper = .lua=lua
>
> the helper directive avoids you to need to set execution permission on cgi
> script
>
> eventually you can use routing too:
>
> route = \.lua$ cgi:/var/www/$(PATH_INFO)
>
>

oops, here is ${PATH_INFO} not $(PATH_INFO) ;)
-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to