Difference between revisions of "System/Apache"

From LunaSys
Jump to navigation Jump to search
(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...")
 
Line 11: Line 11:
 
  CREATE DATABASE apachelogs;
 
  CREATE DATABASE apachelogs;
 
  GRANT INSERT,CREATE ON apachelogs.*  
 
  GRANT INSERT,CREATE ON apachelogs.*  
   TO apachelogger@localhost  
+
   TO apachelog@localhost  
   IDENTIFIED BY 'insert_passwd_here';
+
   IDENTIFIED BY 'password';
 
  FLUSH PRIVILEGES;
 
  FLUSH PRIVILEGES;
  
 
In apache config, add the configuration for the module:
 
In apache config, add the configuration for the module:
  
  LogSQLLoginInfo mysql://apachelogger:insert_passwd_here@localhost/apachelogs
+
  LogSQLLoginInfo mysql://apachelog:password@localhost/apachelogs
 
  LogSQLCreateTables on
 
  LogSQLCreateTables on
 
  LogSQLDBParam socketfile /var/run/mysqld/mysqld.sock
 
  LogSQLDBParam socketfile /var/run/mysqld/mysqld.sock
Line 24: Line 24:
 
In each Virtual Host, add this line:
 
In each Virtual Host, add this line:
  
  LogSQLTransferLogTable this_site_com
+
  LogSQLTransferLogTable table_name_for_this_vhost

Revision as of 17:13, 5 January 2012

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 apachelog@localhost 
 IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

In apache config, add the configuration for the module:

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

In each Virtual Host, add this line:

LogSQLTransferLogTable table_name_for_this_vhost