Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 6849 invoked from network); 10 Jun 2009 01:28:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 01:28:47 -0000 Received: (qmail 57926 invoked by uid 500); 10 Jun 2009 01:28:58 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 57845 invoked by uid 500); 10 Jun 2009 01:28:58 -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 57836 invoked by uid 99); 10 Jun 2009 01:28:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 01:28:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of graham.dumpleton@gmail.com designates 209.85.222.193 as permitted sender) Received: from [209.85.222.193] (HELO mail-pz0-f193.google.com) (209.85.222.193) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 01:28:50 +0000 Received: by pzk31 with SMTP id 31so403447pzk.10 for ; Tue, 09 Jun 2009 18:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W9Qo09dD40FR5609DF4mHKS3uIZetaEa/XUyXxsDSc8=; b=axLakTywIftTg96O/zRIlAhqHm6Nd8Qi1288kRePbGGlyqqayRPF1XPPJnG3AMR4jn KRRxd4YkU1CXROR6kvb4+wl8msRFigo4+7jvjJYR+xMxDQMrk/JstqVxeglL63r5sz0r uHXRvKJQPzXNo2lItXkS11sCdPmL7HlhcSFKU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=M2loChonxHVMNOtk+pYg2V4ND6rI/Dr+uYgxBT8pOGDUwldtvMFD/BcrHKkPhOz7FS lSehNVHPd0/Ig6qMZlDtt2OqAZz6OS9RUTkZ1eDXyCV2iyAntq4LQMehllLbshFmkSn8 yyuPVdTjOL85IDz0WBtn7nT6cFsI+Tb67d/sY= MIME-Version: 1.0 Received: by 10.115.108.5 with SMTP id k5mr1098288wam.186.1244597309629; Tue, 09 Jun 2009 18:28:29 -0700 (PDT) In-Reply-To: References: <88e286470906052031o3c85ab2ak59a626728750d69c@mail.gmail.com> Date: Wed, 10 Jun 2009 11:28:29 +1000 Message-ID: <88e286470906091828v3ee5abber1264af92ce048d4b@mail.gmail.com> Subject: Re: Some ramblings on httpd config From: Graham Dumpleton 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 2009/6/9 Akins, Brian : > On 6/5/09 11:31 PM, "Graham Dumpleton" wrote= : > >> This last example wasn't even related to driving configuration. It was >> in practice an actual handler hook implementation for request >> processing, not configuration phases. > > The way I see it, we have artificially separated configuration from reque= st > processing. Well, I believe that separation already exists. How you would do things in each context would be different. See mod_perl for example: http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html How you write its configuration stuff is quite different to an actual handl= er. > If you squint and tilt your head just right, you can see that > virtualhosts today are really just syntactical sugar over the if/else log= ic > inside of core: Except that for handler the calculation is more dynamic and not driven through static defined data structures setup in configuration phase. > Some pseudo request processing code to do same thing: > =A0if listening_port =3D=3D 80 then > =A0 =A0 if r.hostname =3D=3D 'www.foo.com' then > =A0 =A0 =A0 =A0 .... > =A0 =A0 elseif r.hostname =3D~ /www\d.bar.[org|net]/ > =A0 =A0 end > =A0end > > > Of course this could be further hidden from users with > macros/functions/libraries/modules... > > Now, on the practical side, do we completely ditch the current config > system. =A0Part of me says yes, but I know that will be -1'd to death. = =A0So, > I'd just like the ability to do something like this: > > LoadModule lua_module mod_lua.so > Listen 80 > LuaRequestHandler /path/to/my/lua/handler.lua Huh, are you sure you can't do that now somehow. The vhost module uses translate name hook so if you use LuaHookTranslateName I would presume it would be possible to do something equivalent in lua. > (or it can be inline but have found that to be somewhat cumbersome) > > Because I don't want to rewrite mod_proxy in lua, it'd be nice to have ju= st > a little bit of glue that would allow me to use it in a more "scripty" so= rt > of way: > > LoadModule proxy_module mod_proxy.so > LoadModule proxy_http_module mod_proxy_http.so > .... > =A0require httpd.proxy -- provided by mod_proxy glue > > =A0p =3D httpd.proxy.get_url('http://blah') Again, are you sure there aren't already ways of doing that with mod_lua. Setting up proxying is simple enough to do in mod_python and would be possible with mod_perl as well. For mod_python see example in: http://issues.apache.org/jira/browse/MODPYTHON-141 If mod_lua provides equivalent wrappers for request object, would be done in same way. > (Of course, that example could be handled like we do in mod_rewrite) > > Currently, we can sorta do most request processing in lua. (FWIW, do the > request phases make any sense in a world where the entire request process= is > handled by a "script"??) =A0What is missing is the glue to the other, use= ful > parts of httpd - like cache, mod_dbd, proxy, etc. Getting a bit confused here. You acknowledge you know about request processing phases, but at the same time say you would like to see stuff that I would have thought was already possible. Do not I haven't used mod_lua/mod_wombat, so maybe it doesn't give you level of programmability as modules such as mod_perl and mod_python. > Sure, one of us could hack together some example glue here and there, but > until we as a whole "get" why this is useful/important, it will be just > another list of patches waiting to be reviewed. > > -- > Brian Akins > Chief Operations Engineer > Turner Digital Media Technologies > >