mod_luaex is a module for apache2 that extends mod_lua (http://httpd.apache.org/docs/2.4/mod/mod_lua.html) to support socache, session, dbd, filter and other, making it more flexible.
Back in 2005, I began writing my own Lua module (http://mod-lua.sourceforge.net), inspired by mod_python. A few years later I was glad to see the official mod_lua came out. Because some functionality is missing in the official version, I wanted to write a module that extends it. Lua/APR is a good binding of the Apache Portable Runtime (APR) for Lua, so I embedded it in mod_luaex.
mod_luaex does not replace mod_lua, it works after mod_lua is enabled and active. mod_luaex depends on mod_lua, as well as mod_dbd, mod_session and mod_socache. The target environment is Apache HTTPd 2.4
Please see mod_lua.patch to view what changed.
Open build\mod_luaex.vcproj with MSVC 2008 or 2010.
Please wait until it is finished.
- Change setting in config.win
- nmake -f makefile.win
mod_luaex extends Apache's mod_lua, adding more APIs, such as apreq, apr-dbd, and so on.
####functions puts, write, parseargs, parsebody, add_output_filter*, construct_url,escape_html, ssl_var_lookup, debug, info, notice, warn, err, crit, alert, emerg, trace1, trace2, trace3, trace4, trace5, trace6, trace7, trace8
####strings document_root, protocol, content_type, content_encoding, ap_auth_type, unparsed_uri, filename, canonical_filename, path_info, args, handler, hostname, req_uri_field, uri, the_request, method, proxyreq
####boolean is_https, assbackwards
####integer status
####table headers_in, headers_out, err_headers_out, notes, subprocess_env
if the arg is false, it will return a cookies key and value as apr_table object
if the arg is true, it will return a table, name and cookie object key pair
option table supports the params below
path; /**< Restricts URL path */
domain; /**< Restricts server domain */
port; /**< Restricts server port */
comment; /**< RFC cookies may send a comment */
commentURL; /**< RFC cookies may place an URL here */
max_age; /**< total duration of cookie: -1 == session */
flags; /**< charsets, taint marks, app-specific bits */
charsets, tainted, secure
if the arg is false, it will return an apr_table with query key and value, apreq_args
if the arg is true, it will return an apr_table with post key and value, apreq_body
it will return an apr_table with param which contains upload part
if the argument apr_table is not given, it will be obtained from apreq_body()
it will return a multi param object which contains upload part
arg must be a string as name
If you have questions, bug reports, suggestions, etc. the author can be contacted at zhaozg@gmail.com.
This software is provided under the same license as Apache.
Third party code [Lua/APR] Lua/APR was written in 2011 by Peter Odding (peter@peterodding.com) and a few by zhiguo zhao (zhaozg@gmail.com). [Lua/APR]: http://peterodding.com/code/lua/apr/