Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAB0E109AD for ; Thu, 6 Jun 2013 00:34:35 +0000 (UTC) Received: (qmail 46858 invoked by uid 500); 6 Jun 2013 00:34:34 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 46700 invoked by uid 500); 6 Jun 2013 00:34:34 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 46691 invoked by uid 99); 6 Jun 2013 00:34:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 00:34:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of covener@gmail.com designates 209.85.128.181 as permitted sender) Received: from [209.85.128.181] (HELO mail-ve0-f181.google.com) (209.85.128.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 00:34:27 +0000 Received: by mail-ve0-f181.google.com with SMTP id db10so1729511veb.26 for ; Wed, 05 Jun 2013 17:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=b0KLedrV956eNCAVEAPLhoTCUeg+XUhJlXWylH6bCE0=; b=JsoV3rr3W6oSAq/h6MtNudCkEDFEK6bksLvFIHCbe6kH/qW/30HK/qBbBT2GqyDqAh 3APlDZcUGD6ClenSMQBGX8bK45a0qpSjqJU30gpRRh1xZuoPii8P3tVggOulr29KI3gU pHaBSRvZrEBnZsGmWPp8vxLSyuwVXJLjgBY7JkDpWTAMDdUFR/PlWcm3n4OUymjBicsS FSA62PXaIXoGIDxVLCCV/WhfkXvErQq94dCMHXdKi7BgnfnlURFYR5UCJBSMWSinHVtn /VMYNxxnc5YkZspxf4/WFYISfIkGnaziCmpnIOj9U1NoFUUyTmUH11B+oa1gsB9a4/A5 0cRg== MIME-Version: 1.0 X-Received: by 10.58.6.141 with SMTP id b13mr21482203vea.45.1370478846874; Wed, 05 Jun 2013 17:34:06 -0700 (PDT) Received: by 10.58.152.99 with HTTP; Wed, 5 Jun 2013 17:34:06 -0700 (PDT) In-Reply-To: <51AF988E.2010407@apache.org> References: <51AED697.6080506@gknw.net> <51AF988E.2010407@apache.org> Date: Wed, 5 Jun 2013 20:34:06 -0400 Message-ID: Subject: Re: mod_lua oddities From: Eric Covener To: dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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 =3D apache2.OK= . On Wed, Jun 5, 2013 at 3:59 PM, Guenter Knauf 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 platfor= m - > tested NetWare, Linux and Windows ... > > # curl http://localhost/tellme > > > 404 Not Found > >

Not Found

>

The requested URL /tellme was not found on this server.

> > > [Thu Jun 06 00:05:12.047987 2013] [lua:trace2] [pid 5740:tid > 140544617477888] mod_lua.c(180): [client ::1:56957] AH02313: mapped handl= er > details: scope: once, file: /srv/www/tstlua/fortune.lua, func: handle > [Thu Jun 06 00:05:12.049191 2013] [lua:debug] [pid 5740:tid 1405446174778= 88] > 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 1405446174778= 88] > 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 1405446174778= 88] > 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 1405446174778= 88] > 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 1405446174778= 88] > [client ::1:56957] AH00128: File does not exist: /srv/www/htdocs/tellme > > G=FCn. > > --=20 Eric Covener covener@gmail.com