Nah, it's not quite time to close up shop [1] … (so much for my April Fool's joke this year—most people missed the style changes I did for several years running, but a) most people read the entries here via the newsfeed so the visual change in layout was always lost on them, and b) I never did find that round toit I needed to change the style—anyway, I digess).
I've been looking a bit deeper into Drupal [2] these past few days (seeing how I'm scheduled to give a repeat of my talk [3] at the new West Palm Beach Drupal users group [4] this month—I'm giving a lot of presentations this year it seems) and trying to get into the whole PHP framework and well … as a diversion, I thought it might be interesting to see what type of web-based framework one could do in Lua [5], and why not attempt it using mod_lua [6]?
Well, the fact that I linked to the svn [7] respository should say something about the stability of mod_lua—it ain't. It's only currently available for the latest development version [8] of Apache [9], there's no documentation (except for the source code) and a smattering of example code [10] to guide the intrepid. It's also not terribly reassuring that it hasn't been worked on for a few months.
That didn't stop me from trying it though.
I spent a few hours debugging the module [11], enough for it to pass the few tests available and hopefully, the Apache team will accept the patch (a call to memset() to initialize a structure to a known value before use).
Now that it doesn't crash, it does appear to be quite nice, allowing the same access that any Apache module in C would have, and it looks like one could effectively replace a few of the murkier modules (like mod_rewrite [12]) with more straightforward Lua implementation. My initial thoughts are to reimplement mod_litbook [13] (which currently only works for Apache 1.3x) using mod_lua as a test case (and heck—maybe even upgrade the existing mod_litbook to Apache 2.x so I won't have to keep running an Apache 1.3 instance [14] just for one portion of my website).
[4] http://groups.drupal.org/node/55998
[6] http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/
[7] http://subversion.tigris.org/
[8] http://httpd.apache.org/docs/trunk/
[10] http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/test/
[11] https://issues.apache.org/bugzilla/show_bug.cgi?id=49044
[12] http://httpd.apache.org/docs/trunk/mod/mod_rewrite.html
[13] https://github.com/spc476/mod_litbook