Several Apache modules to allow Apache 2.2+ to access databases using DBD.
These modules work on Windows or Unix with any of the DBD drivers included in the Apache 2 DBD Framework.
See the Building Wiki for instructions to build these modules.
mod_log_dbd
Log web requests to an SQL database
LoadModule log_dbd_module modules/mod_log_dbd.so
...
CustomLog logs/access.sql "%h, %l, %u, %{%Y-%m-%d %H:%M:%S}t, %r, %>s, %b"
DBDLog logs/access.sql "INSERT INTO LogTable (Host, Rname, User, Tstmp, Request, Status, Bytes) \
VALUES (%s, %s, %s, %s, %s, %s, %s)"See the mod_log_dbd Wiki for details.
mod_vhost_dbd
Set the document root directory from an SQL database
LoadModule vhost_dbd_module modules/mod_vhost_dbd.so ... DBDocRoot "SELECT DocRoot FROM WebTable WHERE Host = %s" HOSTNAME
See the mod_vhost_dbd Wiki for details.
Release History
- Version 1.0.5 May 17, 2009 - fix mod_vhost_dbd issue #2 - Some DBD drivers depend on output-argument initial values; set the result pointer to NULL before calling apr_dbd_pselect, and set the row pointer to NULL before the first call to apr_dbd_get_row.
- Version 1.0.4 August 2, 2008 - mod_vhost_dbd retains environment vars correctly on APR 1.3+.
- Version 1.0.3 January 1, 2008 - mod_log_dbd better fallback file when DBDPrepareSQL is used.
- Version 1.0.2 November 26, 2007 - mod_log_dbd fallback file initialized correctly