You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joachim Zobel <jz...@heute-morgen.de> on 2011/06/08 22:06:13 UTC

mod_lua Filter Hook?

Hi.

Will the mod_lua filter hook be implemented in the near future? I am
aware that this requires wrapping buckets and brigades, which is a lot
of work. Are there any plans for generated API wrappers as mod_perl has
them?

Sincerely,
Joachim
 


Re: mod_lua Filter Hook?

Posted by zhiguo zhao <zh...@gmail.com>.
I write a module named mod_luaex, it work with mod_lua, and extend lua
functions that support mod_dbd,mod_session and filter.

Mod_lua will not do big enhance and update according to mod_lua's author
message three month ago.

2011/6/9 Joachim Zobel <jz...@heute-morgen.de>

> Hi.
>
> Will the mod_lua filter hook be implemented in the near future? I am
> aware that this requires wrapping buckets and brigades, which is a lot
> of work. Are there any plans for generated API wrappers as mod_perl has
> them?
>
> Sincerely,
> Joachim
>
>
>

Re: mod_lua Filter Hook?

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On 22.06.2011 22:39, Stefan Fritsch wrote:
> > On Thursday 16 June 2011, Brian McCallister wrote:
> >> My personal use cases for mod_lua are not content generation
> >> oriented, but you should be able to do content generation with it.
> >> I suspect that if you are doing "serious apps" then you will get
> >> more mileage from ruby, python, or perl just because there are a
> >> lot more libraries geared towards that already. All that said,
> >> when i started doing ruby, there were far fewer quality ruby libs
> >> than there are lua libs now :-)
> > 
> > IMHO an interesting use case for mod_lua would be all the places
> > where
> > one can easily plug in additional functions that can then be used
> > without further interaction with mod_lua:
> > 
> > - authz providers
> > - ap_expr functions / variables
> > - additional log formats for CustomLog and ErrorLogFormat
> > - rewrite maps
> 
> And maybe custom load balancing strategies for mod_proxy_balancer.

I think these are all fine ideas, but what needs to be done
to provide the interfaces? -- I think once we started doing that
extending the whole lot to more interfaces will be trivial.
We need to start somewhere to show people how it's done.

> Rainer

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

Re: mod_lua Filter Hook?

Posted by Rainer Jung <ra...@kippdata.de>.
On 22.06.2011 22:39, Stefan Fritsch wrote:
> On Thursday 16 June 2011, Brian McCallister wrote:
>> My personal use cases for mod_lua are not content generation
>> oriented, but you should be able to do content generation with it.
>> I suspect that if you are doing "serious apps" then you will get
>> more mileage from ruby, python, or perl just because there are a
>> lot more libraries geared towards that already. All that said,
>> when i started doing ruby, there were far fewer quality ruby libs
>> than there are lua libs now :-)
> 
> IMHO an interesting use case for mod_lua would be all the places where 
> one can easily plug in additional functions that can then be used 
> without further interaction with mod_lua:
> 
> - authz providers
> - ap_expr functions / variables
> - additional log formats for CustomLog and ErrorLogFormat
> - rewrite maps

And maybe custom load balancing strategies for mod_proxy_balancer.

Rainer

Re: mod_lua Filter Hook?

Posted by Brian McCallister <br...@skife.org>.
On Thu, Jun 23, 2011 at 1:38 AM, Stefan Fritsch <sf...@sfritsch.de> wrote:
> On Thursday 23 June 2011, Igor Galić wrote:
>> > I.e, these APIs should be somehow exposed in mod_lua:
>> >
>> >
>> > ap_register_auth_provider
>> > ap_register_log_handler
>> > ap_register_errorlog_handler
>> > ap_register_rewrite_mapfunc
>> > ap_hook_expr_lookup
>> > ap_register_include_handler
>>
>> Huh? Are they currently not ?
>> I thought it already possible to write custom auth providers
>> with mod_lua (i.e.: OAuth or similar)
>
> "grep provider modules/lua/*c" gives no match. I think mod_lua can be
> used to hook into the various auth/access hooks of httpd core. But
> this does not allow to use mod_authz_core's infrastructure, which
> would make implementing authz a lot simpler.

I agree.

>

Re: mod_lua Filter Hook?

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Thursday 23 June 2011, Igor Galić wrote:
> > I.e, these APIs should be somehow exposed in mod_lua:
> > 
> >
> > ap_register_auth_provider
> > ap_register_log_handler
> > ap_register_errorlog_handler
> > ap_register_rewrite_mapfunc
> > ap_hook_expr_lookup
> > ap_register_include_handler
> 
> Huh? Are they currently not ?
> I thought it already possible to write custom auth providers
> with mod_lua (i.e.: OAuth or similar)

"grep provider modules/lua/*c" gives no match. I think mod_lua can be 
used to hook into the various auth/access hooks of httpd core. But 
this does not allow to use mod_authz_core's infrastructure, which 
would make implementing authz a lot simpler.

Re: mod_lua Filter Hook?

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On Thursday 16 June 2011, Brian McCallister wrote:
> > My personal use cases for mod_lua are not content generation
> > oriented, but you should be able to do content generation with it.
> > I suspect that if you are doing "serious apps" then you will get
> > more mileage from ruby, python, or perl just because there are a
> > lot more libraries geared towards that already. All that said,
> > when i started doing ruby, there were far fewer quality ruby libs
> > than there are lua libs now :-)
> 
> IMHO an interesting use case for mod_lua would be all the places
> where
> one can easily plug in additional functions that can then be used
> without further interaction with mod_lua:
> 
> - authz providers
> - ap_expr functions / variables
> - additional log formats for CustomLog and ErrorLogFormat
> - rewrite maps
> 
> I.e, these APIs should be somehow exposed in mod_lua:
> 
> ap_register_auth_provider
> ap_register_log_handler
> ap_register_errorlog_handler
> ap_register_rewrite_mapfunc
> ap_hook_expr_lookup
> ap_register_include_handler

Huh? Are they currently *not* ?
I thought it already possible to write custom auth providers
with mod_lua (i.e.: OAuth or similar)

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

Re: mod_lua Filter Hook?

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Thursday 16 June 2011, Brian McCallister wrote:
> My personal use cases for mod_lua are not content generation
> oriented, but you should be able to do content generation with it.
> I suspect that if you are doing "serious apps" then you will get
> more mileage from ruby, python, or perl just because there are a
> lot more libraries geared towards that already. All that said,
> when i started doing ruby, there were far fewer quality ruby libs
> than there are lua libs now :-)

IMHO an interesting use case for mod_lua would be all the places where 
one can easily plug in additional functions that can then be used 
without further interaction with mod_lua:

- authz providers
- ap_expr functions / variables
- additional log formats for CustomLog and ErrorLogFormat
- rewrite maps

I.e, these APIs should be somehow exposed in mod_lua:

ap_register_auth_provider
ap_register_log_handler
ap_register_errorlog_handler 
ap_register_rewrite_mapfunc
ap_hook_expr_lookup
ap_register_include_handler


Re: mod_lua Filter Hook?

Posted by Brian McCallister <br...@skife.org>.
On Wed, Jun 15, 2011 at 5:09 PM, Akins, Brian <Br...@turner.com> wrote:
> On 6/15/11 6:26 PM, "HyperHacker" <hy...@gmail.com> wrote:
>
> =
>> I'd been looking forward to mod_lua for a while now expecting it to
>> work similarly to PHP (handle requests, send output without having to
>> worry about how the httpd works). Is that not the case?
>
> Brian M. can correct me, but the original intent for mod_lua (nee
> mod_wombat) was when you needed to get at the internals of Apache, but
> didn't want to write a full on C module.  Like needed nested if's for a
> rewrite, a strange auth method, or whatever.  It was not really meant to be
> a competitor to php, ruby, python, etc. for application development.

My personal use cases for mod_lua are not content generation oriented,
but you should be able to do content generation with it. I suspect
that if you are doing "serious apps" then you will get more mileage
from ruby, python, or perl just because there are a *lot* more
libraries geared towards that already. All that said, when i started
doing ruby, there were far fewer quality ruby libs than there are lua
libs now :-)

I'd like to support bucket brigades, but I do *not* know what the API
should look like. Given good bucket support, filters then become
straightforward.

What I would want in the API:

1) It exposes the same abstractions as the C api, but in a Lua
idiommatic manner.

2) That it interacts properly with C.

-Brian

-Brian

>
> --
> Brian Akins
>
>
>

Re: mod_lua Filter Hook?

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 6/15/2011 6:09 PM, Akins, Brian wrote:
> On 6/15/11 6:26 PM, "HyperHacker" <hy...@gmail.com> wrote:
> 
> = 
>> I'd been looking forward to mod_lua for a while now expecting it to
>> work similarly to PHP (handle requests, send output without having to
>> worry about how the httpd works). Is that not the case?
> 
> Brian M. can correct me, but the original intent for mod_lua (nee
> mod_wombat) was when you needed to get at the internals of Apache, but
> didn't want to write a full on C module.  Like needed nested if's for a
> rewrite, a strange auth method, or whatever.  It was not really meant to be
> a competitor to php, ruby, python, etc. for application development.

E.g. much of mod_perl's flexibility without the overhead of a perl
interpreter instance.

Re: mod_lua Filter Hook?

Posted by "Akins, Brian" <Br...@turner.com>.
On 6/15/11 6:26 PM, "HyperHacker" <hy...@gmail.com> wrote:

= 
> I'd been looking forward to mod_lua for a while now expecting it to
> work similarly to PHP (handle requests, send output without having to
> worry about how the httpd works). Is that not the case?

Brian M. can correct me, but the original intent for mod_lua (nee
mod_wombat) was when you needed to get at the internals of Apache, but
didn't want to write a full on C module.  Like needed nested if's for a
rewrite, a strange auth method, or whatever.  It was not really meant to be
a competitor to php, ruby, python, etc. for application development.

-- 
Brian Akins



Re: mod_lua Filter Hook?

Posted by HyperHacker <hy...@gmail.com>.
On Wed, Jun 15, 2011 at 15:34, Joachim Zobel <jz...@heute-morgen.de> wrote:
> On Wed, 2011-06-15 at 17:04 -0400, Akins, Brian wrote:
>
>> For filters, etc, not sure we really need buckets in Lua.  Maybe just
>> represent them as a table of buffers or something simple like that.
>
> This misses my (admittedly not so important) use case of sax buckets.
> See
> http://www.heute-morgen.de/site/03_Web_Tech/50_Building_an_Apache_XML_Rewriting_Stack.shtml
>
> Sincerely,
> Joachim
>
>
>
>

I'd been looking forward to mod_lua for a while now expecting it to
work similarly to PHP (handle requests, send output without having to
worry about how the httpd works). Is that not the case?

-- 
Sent from my toaster.

Re: mod_lua Filter Hook?

Posted by Joachim Zobel <jz...@heute-morgen.de>.
On Wed, 2011-06-15 at 17:04 -0400, Akins, Brian wrote:

> For filters, etc, not sure we really need buckets in Lua.  Maybe just
> represent them as a table of buffers or something simple like that.

This misses my (admittedly not so important) use case of sax buckets.
See
http://www.heute-morgen.de/site/03_Web_Tech/50_Building_an_Apache_XML_Rewriting_Stack.shtml

Sincerely,
Joachim




Re: mod_lua Filter Hook?

Posted by "Akins, Brian" <Br...@turner.com>.
On 6/15/11 4:08 PM, "Joachim Zobel" <jz...@heute-morgen.de> wrote:

> mod_perl does this pretty good IMHO. The point is auto generation of
> usable API wrappers.

FWIW, and this is just my opinion, but I'm not not 100% sure that having a
complete (or near) complete Lua version of the HTTPD (and APR) API is really
worth the effort.  I've grown to like the very simple way some other web
servers have done it.  I've also learn to write as much code in Lua as
possible and just have the low level glue in C, especially with the jit.

For filters, etc, not sure we really need buckets in Lua.  Maybe just
represent them as a table of buffers or something simple like that.

-- 
Brian Akins



Re: mod_lua Filter Hook?

Posted by Joachim Zobel <jz...@heute-morgen.de>.
On Mon, 2011-06-13 at 11:14 -0600, Brian McCallister wrote:
> I'd very much like to support filters in mod_lua, but have not had a
> chance to figure out the best way to do it. Help would be VERY
> appreciated :-) 

mod_perl does this pretty good IMHO. The point is auto generation of
usable API wrappers.

How do the different options for adding filter support look like?

Sincerely,
Joachim





Re: mod_lua Filter Hook?

Posted by Brian McCallister <br...@skife.org>.
On Wed, Jun 8, 2011 at 2:06 PM, Joachim Zobel <jz...@heute-morgen.de> wrote:
> Hi.
>
> Will the mod_lua filter hook be implemented in the near future? I am
> aware that this requires wrapping buckets and brigades, which is a lot
> of work. Are there any plans for generated API wrappers as mod_perl has
> them?

I'd very much like to support filters in mod_lua, but have not had a
chance to figure out the best way to do it. Help would be VERY
appreciated :-)

>
> Sincerely,
> Joachim
>
>
>