System/Apache

From LunaSys
Revision as of 16:16, 29 May 2012 by Eadam (talk | contribs)
Jump to navigation Jump to search

openssl

Remove passphrase from key:

openssl rsa -in server.key -out server-nopass.key

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