I found that mod_log_mysql was missing some details, so I wasn't able to immediately try it. It does have more flexibility once you learn how to use it. The best description is at: http://bitbrook.de/software/mod_log_mysql/

What I was able to use was mod_log_sql. It is better documented, at outoforder.cc, there is an apt package for easy installation in Ubuntu, and it partially works when activated. There is a scorecard table which I had to manually create (scorecard is apparently a recent modification).

LogSQLDatabase your_log_table
LogSQLLoginInfo mysql://your_logging_db_user:your_password_here@localhost/your_log_table
LogSQLCreateTables on
LogSQLDBParam socketfile /var/run/mysqld/mysqld.sock
LogSQLTransferLogFormat AbHhmRSsTUuvI
  1. Note: 'c' requires LogSQLWhichCookie
  2. Note: 'I' requires: Apache module unique_id: a2enmod unique_id
  1. Check the Apache error log after enabling mod_log_sql for errors such as a nonexistent score_board.
  1. SQL which might be needed once to create the scoreboard:
  2. CREATE TABLE IF NOT EXISTS `scoreboard` (
  3. `id` int(14) NOT NULL auto_increment,
  4. `vhost` varchar(50) NOT NULL default '',
  5. `bytes_sent` int(14) NOT NULL default '0',
  6. `count_hosts` int(12) NOT NULL default '0',
  7. `count_visits` int(12) NOT NULL default '0',
  8. `count_status_200` int(12) NOT NULL default '0',
  9. `count_status_404` int(12) NOT NULL default '0',
  10. `count_impressions` int(18) NOT NULL default '0',
  11. `last_run` int(14) NOT NULL default '0',
  12. `month` int(4) NOT NULL default '0',
  13. `year` int(4) NOT NULL default '0',
  14. `domain` varchar(50) NOT NULL default '',
  15. `bytes_receive` int(14) NOT NULL default '0',
  16. PRIMARY KEY (`id`),
  17. UNIQUE KEY `vhost` (`vhost`,`month`,`year`,`domain`)
  18. ) TYPE=MyISAM;
  1. LogSQLScoreDomain -> this is what will be targeted when doing the UPDATE
  2. query, default is default-domain.tld
  3. LogSQLScoreSubdomain -> this is what will be targeted when doing the
  4. UPDATE query, default is www
  5. LogSQLScoreTable -> this is the score table used for doing the stats
  1. Now turn on the logging.
LogSQLScoreDomain reallysimplechat.org LogSQLScoreSubdomain www LogSQLTransferLogTable reallysimplechat_access_log



Another detail which I didn't see mentioned is that both of these modules work alongside the others. If you still want the traditional text file logging, you can have that running in addition to the SQL copy of the data. And you may as well run both while you test the new tools.