System/Apache

From LunaSys
Revision as of 17:13, 5 January 2012 by Eadam (talk | contribs) (Created page with "== RPAF == == MySQL logging == Install the module apt-get install libapache2-mod-log-sql-mysql Create database and grant access to mysql user: CREATE DATABASE apachelog...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

RPAF

MySQL logging

Install the module

apt-get install libapache2-mod-log-sql-mysql

Create database and grant access to mysql user:

CREATE DATABASE apachelogs;
GRANT INSERT,CREATE ON apachelogs.* 
 TO apachelogger@localhost 
 IDENTIFIED BY 'insert_passwd_here';
FLUSH PRIVILEGES;

In apache config, add the configuration for the module:

LogSQLLoginInfo mysql://apachelogger:insert_passwd_here@localhost/apachelogs
LogSQLCreateTables on
LogSQLDBParam socketfile /var/run/mysqld/mysqld.sock
LogSQLTransferLogFormat AabfHhmRSsTUuvI

In each Virtual Host, add this line:

LogSQLTransferLogTable this_site_com