mod_mruby to provide an alternative to mod_lua

2013-01-20 Thread MATSUMOTO Ryosuke
Hi, all

I'm Ryosuke MATSUMOTO, a Ph.D. student at Okabe Lab,  Network
Media Group Department of Intelligence Science and Technology
Graduate School of Informatics, Kyoto University in Japan.

My English is not very good, but I am studying at the moment to communicate
developers of the world.

I have been developing mod_mruby and ngx_mruby from Apr 2012.

mod_mruby is a web server extension mechanism using embeddable
scripting language mruby which has been attracting attention now.

mod_mruby abstract:
-
As the increase of services using Web servers, the number of incidents
also is increasing rapidly. In order to solve those problems, it is necessary
to extend a functionality of a Web server software.

In case of using Apache, developers are required high coding skill of C
language and internal specifications of Apache in order to extend the
functionality of it.

The development of a web server extension requires some high skills, and
the maintainability is low since that extension need to compile a code.

Therefore, we propose mod_mruby that is a web server extension mechanism
using embeddable scripting language mruby which has been attracting
attention now. mod_mruby allows to extend the functionality of Apache
easily by implementing a mruby script. mod_mruby provides an interface
to hook and execute any mruby scripts in the various phases of processing
requests inside Apache. When hooking mruby scripts, mruby scripts can
process the data of processing requests inside Apache, taking advantage
of the characteristics of a embeddable scripting language for C language.

We have designed that mod_mruby run at high speed by sharing the data
of state transition and the extension library of mruby by multiple
mruby scripts
and using only different byte code each mruby script.

Many developers can implement a web server extension easily by mod_mruby
 in cooperation with coding style of mruby which is the same as object oriented
 programming ruby which is widely used by web developers.
-

see slide share about mod_mruby architecture and performance compared with
mod_lua, mod_per, and a module written by C language.(Sorry in Japanese)

http://www.slideshare.net/matsumoto_r/mrubyweb

and mod_mruby receive some glowing notices bellow uri:

https://plus.google.com/114552443805676710515/posts/Jbh4S3Zsz2S
http://matt.aimonetti.net/posts/2012/04/25/getting-started-with-mruby/
and mod_mruby was referred form the keynote of mruby by Matz like
http://www.everytalk.tv/talks/657-Euroko-Keynote .

see mruby github:

https://github.com/mruby/mruby

mod_mruby allows to extend the functionality of Apache easily.
mod_mruby proveid an alternative to mod_lua.

see mod_mruby github:

https://github.com/matsumoto-r/mod_mruby

- example
-- proxy by mod_mruby
https://github.com/matsumoto-r/mod_mruby/tree/master/example/proxy

-- support redis and auth provide using mruby-redis
https://github.com/matsumoto-r/mod_mruby/blob/master/example/redis

-- support auth provide
https://github.com/matsumoto-r/mod_mruby/tree/master/example/auth

-- support limit control
https://github.com/matsumoto-r/mod_mruby/tree/master/example/limit_control

-- support rewrite
https://github.com/matsumoto-r/mod_mruby/tree/master/example/rewrite

-- support vhosts
https://github.com/matsumoto-r/mod_mruby/tree/master/example/vhost

-- support cgroup using mruby-cgroup
https://github.com/matsumoto-r/mod_mruby/tree/master/example/cgroup

-- support Raspberry Pi (hobby)
https://github.com/matsumoto-r/mod_mruby/tree/master/example/RaspberryPi

and so on..

I write some entry about mod_mruby in my blog (Sorry Japanese)
http://blog.matsumoto-r.jp/

So, How do you feel about mod_mruby? I would appreciate it if you could
give me your opinion.

I'll attend ApacheCon NA 2013 and I'm looking forward to seeing apache
developers!

Best regards,

-- 
MATSUMOTO Ryosuke  matsu1229 at gmail.com 
http://blog.matsumoto-r.jp/


mod_macro has been added

2013-01-20 Thread Fabien


Hello devs,

I've been given the go to add mod_macro to httpd trunk, see r1435811.

The module is in modules/core. There are English and French documentations 
and extensive non regression tests. The module is compiled in with most. 
It is fully independent, i.e. I have not changed or modified core stuff 
for the module. I think it is safe and may be considered for backporting 
to 2.4, as well as the Warning directive added some time ago.


I'm not sure about how to advertise the use of the module. Possibly 
something in the standard default configuration, maybe some carefully 
designed example macros could be defined and use here and there to show 
how great that can be?


Also, maybe some mention of the module should appear in configuring and 
sections in the documentation?


--
Fabien


Re: mod_mruby to provide an alternative to mod_lua

2013-01-20 Thread Daniel Gruno
On 01/20/2013 10:31 AM, MATSUMOTO Ryosuke wrote:
 Hi, all
 
 I'm Ryosuke MATSUMOTO, a Ph.D. student at Okabe Lab,  Network
 Media Group Department of Intelligence Science and Technology
 Graduate School of Informatics, Kyoto University in Japan.
 
 My English is not very good, but I am studying at the moment to communicate
 developers of the world.
 
 I have been developing mod_mruby and ngx_mruby from Apr 2012.
 
 mod_mruby is a web server extension mechanism using embeddable
 scripting language mruby which has been attracting attention now.
 
 mod_mruby abstract:
 -
 As the increase of services using Web servers, the number of incidents
 also is increasing rapidly. In order to solve those problems, it is necessary
 to extend a functionality of a Web server software.
 
 In case of using Apache, developers are required high coding skill of C
 language and internal specifications of Apache in order to extend the
 functionality of it.
 
 The development of a web server extension requires some high skills, and
 the maintainability is low since that extension need to compile a code.
 
 Therefore, we propose mod_mruby that is a web server extension mechanism
 using embeddable scripting language mruby which has been attracting
 attention now. mod_mruby allows to extend the functionality of Apache
 easily by implementing a mruby script. mod_mruby provides an interface
 to hook and execute any mruby scripts in the various phases of processing
 requests inside Apache. When hooking mruby scripts, mruby scripts can
 process the data of processing requests inside Apache, taking advantage
 of the characteristics of a embeddable scripting language for C language.
 
 We have designed that mod_mruby run at high speed by sharing the data
 of state transition and the extension library of mruby by multiple
 mruby scripts
 and using only different byte code each mruby script.
 
 Many developers can implement a web server extension easily by mod_mruby
  in cooperation with coding style of mruby which is the same as object 
 oriented
  programming ruby which is widely used by web developers.
 -
 
 see slide share about mod_mruby architecture and performance compared with
 mod_lua, mod_per, and a module written by C language.(Sorry in Japanese)
 
 http://www.slideshare.net/matsumoto_r/mrubyweb
 
snip

Hi, Matsumoto,

Your project does indeed look interesting, and for those more accustomed
to Ruby, perhaps this is a good alternative.

I have tried to compile and install mod_mruby on my own machine to test
it, but there are too many compiler errors for it to work :( In
particular, you have a lot of declarations after statements in your
code, which is not C90 compliant, and needs fixing. There are also some
errors that force the source code to use 2.2 standards when compiling it
for 2.4 or 2.5 - this also needs to be addressed:

ap_mrb_connection.c:31 says: #ifdef __APACHE24__
This should probably change to: #if (AP_SERVER_MINORVERSION_NUMBER  2)

I am very interested in how you got to the benchmark results you did.
Statistically speaking, Ruby is a very slow language compared to Lua
(and in particular LuaJIT which is extremely fast - if you attend my
talk at ACNA, I'll show you just how fast ;) ). Which optimizations did
you make to the configuration? Which scopes and code caching options did
you use for your testing? Did you test mod_lua fom the 2.4 branch or the
trunk?

I'd also be interested in an English version of your slides, as there
may be things to learn from it :)

We embrace competition here at Apache, so mod_mruby is a most welcome
addition, however I'd really like to get my hands on a working copy, so
I can test it out and see what it can really do. One advantage that I
could see from the source code is the ability to hook into the logging
part of httpd, which is something mod_lua currently lacks. I did not see
any filter hooks though - is this something you plan to add, or did I
just miss it?

With regards,
Daniel.


Re: Plea for eyes (and votes) on STATUS proposals

2013-01-20 Thread Daniel Ruggeri
On 1/17/2013 6:52 AM, Jim Jagielski wrote:
 *ping* :)

 (yeah, I am kinda pushing/hoping for the balancer
 stuff to be in 2.4.4 in time for ACNA13)


BalancerPersist:
Tested fine and works as expected (+1)
Side note A lot of folks look at the configuration file as the
canonical source for how the server is configured. With dynamic changes
persisted, aspects of the configuration can be incorrect. Seems like a
lot of work, but it may be worth considering a patch to WARN if the conf
vs restored configs differ.


BalancerInherit:
Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=52402 hampers
testing of BalancerInherit On case. Bug notes imply that current 2.4
branch should have a fix for balancer at server level with many vhosts,
but no one really calls out which commit should fix it so I can confirm.
Tested with current 2.4.x branch w/ proxypassinherit.patch only...
Before giving a vote, I'd like to be able to confirm that balancers at
the server level work again. What patch is needed for this?

Small note: This seemed to have no effect on ProxyPass statement
inheritance from server level to vhosts when BalancerInherit was set to
Off. Docs seems to imply that it controls ProxyPass workers just the
same. Maybe docs just need to be more clear? Instead of ProxyPassed
balancers/workers maybe say BalancerMember?

Also, I think there should be more info about the noted inconsistencies
for server-defined balancers/proxypass statements. A good example would
be that the persist patch would not work on server-defined balancers if
changes are made in the vhost. Other than that, I'm not sure what other
inconsistencies and problems would be expected so it's probably worth
warning server admins in docs.

--
Daniel Ruggeri



Re: [Discuss] Time to rewrite/rethink modules.apache.org?

2013-01-20 Thread Graham Leggett
On 20 Jan 2013, at 1:26 AM, Daniel Gruno rum...@cord.dk wrote:

 So, to summarize:
 
 - modules.apache.org needs a general overhaul and a more detailed,
 dynamic approach to its way of handling/relaying information.
 - I propose we rebuild it from scratch, possibly using mod_lua as the
 driving engine, to showcase some of its uses.
 - I propose that we scrap the old data and start anew with modules that
 are still usable for httpd 2.2 and above.
 - I propose that this be a collaboration between those who express an
 interest in being part of it.
 - I propose that moderation/approval on the site be a joint venture
 between all committers who themselves have already shown merit to join
 the ASF.

+1 on all counts.

Regards,
Graham
--



smime.p7s
Description: S/MIME cryptographic signature


Re: [Discuss] Time to rewrite/rethink modules.apache.org?

2013-01-20 Thread Nick Kew

On 19 Jan 2013, at 23:26, Daniel Gruno wrote:

 Hello dear dev@,
 
 I'd like to propose that we rewrite and rethink modules.apache.org.

Aha, the perennial call of the new contributor :) 

Seriously though, thanks for taking up this old chestnut.
Let me throw my usual suggestion in to the ring, and see if
your enthusiasm can inspire me to start hacking this time round.

Since the modules are written by multiple independent developers,
maintenance of the index should be delegated to those same folks.
An author should not have to trouble the index every time they make
an update.

That means, m.a.o should basically be an aggregator.

Each contributor produces a DOAP file describing their module(s).
m.a.o runs a simple bot that crawls those files and aggregates
the contents.  Human intervention is only required when a new
contributor submits a new DOAP URL.  Or if problems are spotted.

Automated procedures then check the DOAP and notify parse errors.
It can also notify of new pages introduced (the contents at a DOAP URL
may describe more than one module), and major changes to existing
pages.

That leaves just the question of search and browse tools.
I guess we can offer browse by a range of categories and keywords,
but for free text search I'd delegate to a google search (possibly hidden).

-- 
Nick Kew


RE: Add bandwidth information to access_log

2013-01-20 Thread Chau Pham
Thank Christian for your suggestion,
  Date: Fri, 18 Jan 2013 10:57:11 +0100
 From: christian.fol...@netnea.com
 To: dev@httpd.apache.org
 Subject: Re: Add bandwidth information to access_log
 
 Hey!
 
 You should look up the individual values in the mod_log_config
 documentation. The bytecount does not constitute the
 bandwidth. You have to take the time into your calculation
 as well. ModSecurity can give you those timings.
 You should look it up there and maybe turn to the mod-security
 mailinglist for help. This list is for httpd development.
 
 Cheers,
 
 Christian Folini
 
 Then you should turn to the ModSecurity
 On Fri, Jan 18, 2013 at 09:33:04AM +, Chau Pham wrote:
  Thank you, I saw this line below in access log while it was playing m3u3 
  file, one of chunk below. 172.16.33.168 - - [18/Jan/2013:16:28:38 +0900] 
  GET /data/That_is_love-46.ts HTTP/1.1 200 2019496 The number 2019496,  
  does it stand for network traffic? I think it is in byte count, Can I 
  consider that as bandwidth? 
Date: Fri, 18 Jan 2013 09:37:01 +0100
   From: christian.fol...@netnea.com
   To: dev@httpd.apache.org
   Subject: Re: Add bandwidth information to access_log
   
   Hi there,
   
   On Fri, Jan 18, 2013 at 08:31:25AM +, Chau Pham wrote:
I would like to add some bandwidth information to http server log file: 
access_log,
   
   The Apache Security Book by Ivan Ristic has a recipe doing that with a
   former version of ModSecurity. ModSec has since changed its timestamps
   but it is still possible to get a value which more or less represents
   up- and downstream bandwidth. Still, you should not trust it too much.
   
   Regs,
   
   Christian Folini
   
   -- 
   Christian Folini - christian.fol...@netnea.com

 
 -- 
 Christian Folini - christian.fol...@netnea.com
  

Re: mod_mruby to provide an alternative to mod_lua

2013-01-20 Thread 松本 亮介
Hi Daniel.

Thank you for your comment. 

 I have tried to compile and install mod_mruby on my own machine to test
 it, but there are too many compiler errors for it to work :( In
 particular, you have a lot of declarations after statements in your
 code, which is not C90 compliant, and needs fixing. There are also some

Did you built mruby? If you don't build murky,  you try to build by bellow 
commands.

- mruby and mod_mruby build
git clone git://github.com/matsumoto-r/mod_mruby.git
cd mod_mruby
git submodule init
git submodule update
cd murby
rake
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs 
--with-apachectl=/usr/local/apache/bin/apachectl
make
make install

- mod_mruby settings
cp -p test/test.mrb /usr/local/apache/htdocs/.
vi /usr/local/apache/conf/httpd.con
(snip)
LoadModule mruby_module   modules/mod_mruby.so
AddHandler mruby-script .mrb
(snip)
/usr/local/apache/bin/apachectl start

- mod_mruby test
http://youraddress/test.mrb

 errors that force the source code to use 2.2 standards when compiling it
 for 2.4 or 2.5 - this also needs to be addressed:
 
 ap_mrb_connection.c:31 says: #ifdef __APACHE24__
 This should probably change to: #if (AP_SERVER_MINORVERSION_NUMBER  2)


it's smart!  Thanks. Now, configure script figure out apache version from 
apachectl.

 I am very interested in how you got to the benchmark results you did.
 Statistically speaking, Ruby is a very slow language compared to Lua
 (and in particular LuaJIT which is extremely fast - if you attend my
 talk at ACNA, I'll show you just how fast ;) ). Which optimizations did
 you make to the configuration? Which scopes and code caching options did
 you use for your testing? Did you test mod_lua fom the 2.4 branch or the
 trunk?

I want to attend your talk about mod_lua and lua JIT. I'm getting really 
excited.

 I'd also be interested in an English version of your slides, as there
 may be things to learn from it :)
 
 We embrace competition here at Apache, so mod_mruby is a most welcome
 addition, however I'd really like to get my hands on a working copy, so
 I can test it out and see what it can really do. One advantage that I
 could see from the source code is the ability to hook into the logging
 part of httpd, which is something mod_lua currently lacks. I did not see
 any filter hooks though - is this something you plan to add, or did I

OK. I'll write a paper about mod_mruby in English, and present my work in an 
international symposium in a few month.

Regards,
Ryosuke.

MATSUMOTO Ryosuke  matsu1229 at gmail.com 
http://blog.matsumoto-r.jp/

On 2013/01/20, at 21:31, Daniel Gruno rum...@cord.dk wrote:

 On 01/20/2013 10:31 AM, MATSUMOTO Ryosuke wrote:
 Hi, all
 
 I'm Ryosuke MATSUMOTO, a Ph.D. student at Okabe Lab,  Network
 Media Group Department of Intelligence Science and Technology
 Graduate School of Informatics, Kyoto University in Japan.
 
 My English is not very good, but I am studying at the moment to communicate
 developers of the world.
 
 I have been developing mod_mruby and ngx_mruby from Apr 2012.
 
 mod_mruby is a web server extension mechanism using embeddable
 scripting language mruby which has been attracting attention now.
 
 mod_mruby abstract:
 -
 As the increase of services using Web servers, the number of incidents
 also is increasing rapidly. In order to solve those problems, it is necessary
 to extend a functionality of a Web server software.
 
 In case of using Apache, developers are required high coding skill of C
 language and internal specifications of Apache in order to extend the
 functionality of it.
 
 The development of a web server extension requires some high skills, and
 the maintainability is low since that extension need to compile a code.
 
 Therefore, we propose mod_mruby that is a web server extension mechanism
 using embeddable scripting language mruby which has been attracting
 attention now. mod_mruby allows to extend the functionality of Apache
 easily by implementing a mruby script. mod_mruby provides an interface
 to hook and execute any mruby scripts in the various phases of processing
 requests inside Apache. When hooking mruby scripts, mruby scripts can
 process the data of processing requests inside Apache, taking advantage
 of the characteristics of a embeddable scripting language for C language.
 
 We have designed that mod_mruby run at high speed by sharing the data
 of state transition and the extension library of mruby by multiple
 mruby scripts
 and using only different byte code each mruby script.
 
 Many developers can implement a web server extension easily by mod_mruby
 in cooperation with coding style of mruby which is the same as object 
 oriented
 programming ruby which is widely used by web developers.
 -
 
 see slide share about mod_mruby architecture and performance compared with
 mod_lua, mod_per, and a module written by C language.(Sorry in Japanese)
 
 http://www.slideshare.net/matsumoto_r/mrubyweb
 
 snip