httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: mod_lua oddities
Date Thu, 06 Jun 2013 00:34:06 GMT
This is a bug in the example and/or the code. If you don't return a
HTTP status code, or apache2.OK, the request is declined and handled
by the core.

I am split between returning 500 or assuming no return value = apache2.OK.

On Wed, Jun 5, 2013 at 3:59 PM, Guenter Knauf <fuankg@apache.org> wrote:
> On 05.06.2013 08:11, Gregg Smith wrote:
>>
>> Hi folks,
>>
>> The more eyes the better I've been told. Sorry that it's lengthy.
>>
>> x86 VC9 *Release* Build
>> httpd version  : 2.4.5-r1489105
>> mod_lua from trunk at r1487956
>>
>> Odd results:
>>      ServerRoot "C:/Apache24A"
>>
>> 1. Running scripts fortune.lua or example.lua via URL works.
>>
>> 2. With
>>      LuaMapHandler /testlua htdocs/lua/example.lua
>>      LuaMapHandler /fortune htdocs/lua/fortune.lua
>>
>> Running fortune.lua via URL 500s
>> example.lua runs fine via URL
>>
>> 3.
>>      LuaMapHandler /testlua htdocs/lua/example.lua
>>      LuaMapHandler /tellme htdocs/lua/fortune.lua
>>
>> both scripts run fine from URL, so there's some kind of leak where
>> http://localhost/lua/fortune.lua becomes
>> http://localhost/fortune to the server
>>
>> 4.
>>      LuaMapHandler /testlua htdocs/lua/example.lua
>>      LuaMapHandler /tellme htdocs/lua/fortune.lua
>>
>> http://localhost/tellme
>> http://localhost/testlua
>> error 500
>>
>> [Tue Jun 04 22:53:30.410000 2013] [lua:error] [pid 3984:tid 948]
>> AH01482: Error loading C:/Apache24A/bin/htdocs/lua/example.lua: cannot
>> open C:/Apache24A/bin/htdocs/lua/example.lua: No such file or directory
>> [Tue Jun 04 22:53:30.410000 2013] [lua:crit] [pid 3984:tid 948] [client
>> ::1:53940] AH02330: lua: Failed to obtain lua interpreter for handle
>> htdocs/lua/example.lua, referer: http://localhost/lua/
>>
>> Notice mod_lua is adding /bin to the file location!
>> cannot open C:/Apache24A/bin/htdocs/lua/example.lua
>>
>> This as you can see is not the location I have it set to look for the
>> script per documented configuration rules about relative paths.
>>
>> Interestingly, mod_lua seems to get it right at first it looks then
>> blows up.
>>
>> [Tue Jun 04 22:53:15.543200 2013] [lua:trace1] [pid 3984:tid 948]
>> mod_lua.c(261): [client ::1:53939] AH01472: handling
>> [C:/Apache24A/htdocs/lua/example.lua] in mod_lua, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:trace2] [pid 3984:tid 948]
>> mod_lua.c(177): [client ::1:53939] AH02313: request handler details:
>> scope: once, file: C:/Apache24A/htdocs/lua/example.lua, func: handle,
>> referer: http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:trace3] [pid 3984:tid 948]
>> mod_lua.c(281): [client ::1:53939] AH01474: got a vm!, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1702): [client ::1:53939] AH01487:
>> request_rec->dispatching puts -> lua_CFunction, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1711): [client ::1:53939] AH01488:
>> request_rec->dispatching method -> string, referer: http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1702): [client ::1:53939] AH01487:
>> request_rec->dispatching parseargs -> lua_CFunction, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:15.543200 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1702): [client ::1:53939] AH01487:
>> request_rec->dispatching puts -> lua_CFunction, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:trace1] [pid 3984:tid 948]
>> mod_lua.c(261): [client ::1:53939] AH01472: handling
>> [C:/Apache24A/htdocs/lua/fortune.lua] in mod_lua, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:trace2] [pid 3984:tid 948]
>> mod_lua.c(177): [client ::1:53939] AH02313: request handler details:
>> scope: once, file: C:/Apache24A/htdocs/lua/fortune.lua, func: handle,
>> referer: http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:trace3] [pid 3984:tid 948]
>> mod_lua.c(281): [client ::1:53939] AH01474: got a vm!, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1692): [client ::1:53939] AH01486:
>> request_rec->dispatching headers_out -> apr table, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1692): [client ::1:53939] AH01486:
>> request_rec->dispatching headers_out -> apr table, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1692): [client ::1:53939] AH01486:
>> request_rec->dispatching headers_out -> apr table, referer:
>> http://localhost/lua/
>> [Tue Jun 04 22:53:19.646000 2013] [lua:debug] [pid 3984:tid 948]
>> lua_request.c(1702): [client ::1:53939] AH01487:
>> request_rec->dispatching puts -> lua_CFunction, referer:
>> http://localhost/lua/
>>
>>
>> 5. With:
>>      LuaMapHandler /testlua C:/Apache24A/htdocs/lua/example.lua
>>      LuaMapHandler /tellme C:/Apache24A/htdocs/lua/fortune.lua
>>
>> Set with full path these 404.
>> http://localhost/tellme
>> http://localhost/testlua
>>
>> 6.  Adding LuaRoot
>>      LuaRoot htdocs/lua
>>      LuaMapHandler /testlua htdocs/lua/example.lua
>>      LuaMapHandler /tellme htdocs/lua/fortune.lua
>>
>> http://localhost/tellme
>> http://localhost/testlua
>>
>> Both crash!
>>
>> Guenter has confirmed some of this behavior in Netware, I'll let him
>> chime in on which.
>
> yes, I can confirm that LuaMapHandler does not work for me on any platform -
> tested NetWare, Linux and Windows ...
>
> # curl http://localhost/tellme
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>404 Not Found</title>
> </head><body>
> <h1>Not Found</h1>
> <p>The requested URL /tellme was not found on this server.</p>
> </body></html>
>
> [Thu Jun 06 00:05:12.047987 2013] [lua:trace2] [pid 5740:tid
> 140544617477888] mod_lua.c(180): [client ::1:56957] AH02313: mapped handler
> details: scope: once, file: /srv/www/tstlua/fortune.lua, func: handle
> [Thu Jun 06 00:05:12.049191 2013] [lua:debug] [pid 5740:tid 140544617477888]
> lua_request.c(1712): [client ::1:56957] AH01486: request_rec->dispatching
> headers_out -> apr table
> [Thu Jun 06 00:05:12.049216 2013] [lua:debug] [pid 5740:tid 140544617477888]
> lua_request.c(1712): [client ::1:56957] AH01486: request_rec->dispatching
> headers_out -> apr table
> [Thu Jun 06 00:05:12.049224 2013] [lua:debug] [pid 5740:tid 140544617477888]
> lua_request.c(1712): [client ::1:56957] AH01486: request_rec->dispatching
> headers_out -> apr table
> [Thu Jun 06 00:05:12.049235 2013] [lua:debug] [pid 5740:tid 140544617477888]
> lua_request.c(1722): [client ::1:56957] AH01487: request_rec->dispatching
> puts -> lua_CFunction
> [Thu Jun 06 00:05:12.049265 2013] [core:info] [pid 5740:tid 140544617477888]
> [client ::1:56957] AH00128: File does not exist: /srv/www/htdocs/tellme
>
> Gün.
>
>



-- 
Eric Covener
covener@gmail.com

Mime
View raw message