Sunday, November 8, 2009

httpd-devel mysql-devel

As a result i created a page that would be accesble by users to log on to and check the log for now. its working fine.
and about the mysql_mob. here you go the simple steps done on Fedora machine as an example.

1 - yum install httpd-devel mysql-devel make bzip2
2 - wget http://www.outoforder.cc/downloads/m...-1.101.tar.bz2
3 - tar xvjf mod_log_sql-1.101.tar.bz2
4 - cd mod_log_sql-1.101
5 - ./configure
6 - gmake
7 - gmake install
8 - /etc/init.d/mysql start or service mysqld start
9 - log on mysql with root and run this command.
a - create database apachelogs;
b - use apachelogs
c - source /"path"/mod_log_sql/contrib/create_table.sql
where "path" is the path for the mod_log_sql folder unzipped, which would create tables and fields.
d - grant insert,create on apachelogs.* to 'loguser'@'localhost' identified by 'password' ;
e - flush privileges ;
10 - vi /etc/httpd/conf/httpd.conf and add the following lines in the mod section in the conf file.
a - LoadModule log_sql_module modules/mod_log_sql.so
b - LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
c - LogSQLLoginInfo mysql://loguserassword@localhost/apachelogs
d - LogSQLDBParam socketfile /var/lib/mysql/mysql.sock
e - LogSQLCreateTables on
11 - comment out access_log and Error_log and add those two lines.
a - LogSQLTransferLogTable access_log
b - LogSQLTransferLogFormat AabcfHhIlMmPpRrSsTtUuvio

it should look like something like this.

DocumentRoot /var/www/html/
ServerName yourdomain.com
#ErrorLog logs/youdomain.com-error_log
#CustomLog logs/yourdomain.com-access_log common
LogSQLTransferLogTable access_log
LogSQLTransferLogFormat AabcfHhIlMmPpRrSsTtUuvio
12 - finally , service httpd restart , or /etc/init.d/httpd restart