mod-log-mysql-simple is an Apache 1.3.x module that can solve the problem of logging multiple virtual hosts to a single database. It is intentionally extremely simple.
To use this module you'll need a copy of Apache, and a machine running a mysql database. The database doesnt' necessarily have to be upon the same host as the webserver, so long as it is possible for a client to connect to it.
If you wish to build the code from source you'll need the Apache development sources for your Linux platform and the mysqlclient development packages too.
For Debian GNU/Linux systems the following command should be sufficient to install the dependencies:
apt-get install apache-dev libmysqlclient10-dev
There are only a few configuration options to play with:
DatabaseHost The hostname of the database server.
DatabaseUser The username to connect as.
DatabasePass The password for the given user.
DatabaseName The name of the database to connect to.
DatabaseTable The name of the table to insert entries into.
Sample configuration would look like this:
LoadModule mod_log_mysql_simple /usr/lib/apache/1.3/mod_log_mysql_simple.so
< IfModule mod_log_sql_simple.c >
< /IfModule >
This would require the database table to be already setup as described in the README.