Bug 82486 - mod_log_sql configuration file is incorrect.
Bug#: 82486 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: major Priority: P2
Resolution: FIXED Assigned To: apache-bugs@gentoo.org Reported By: chtekk@gentoo.org
Component: Server
URL: 
Summary: mod_log_sql configuration file is incorrect.
Keywords:  
Status Whiteboard: 
Opened: 2005-02-18 11:41 0000
Description:   Opened: 2005-02-18 11:41 0000
Hi, I've noticed some problems with the shipped mod_log_sql config file
(10_mod_log_sql.conf):
1) There is no mention of the LogSQLLoginInfo directive in that file, but that
directive is strictly necessary to let the module work! Please add it. (See
http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/#Sect.ConfigReference)
2) You use "LogSQLDBParam user loguser" etc. to specify the database connection
proprieties, that should be done with LogSQLLoginInfo and thus after the change
in 1) these lines are unnecessary.
3) "LogSQLCreateTables on" is there two times, one time it's commented with the
mention that it isn't needed, the second time it's there, but like in the first
mention: it is not needed since you turn "LogSQLMassVirtualHosting on" earlier.
4) With the new 1.100 version in portage, done with the new Apache ebuild
classes, I noticed that also if you use Apache2, the config files is always
/usr/portage/net-www/mod_log_sql/files/10_mod_log_sql.conf, and not
10_mod_log_sql_apache2.conf like it should be, thus you get a config file with
"LogSQLPreserveFile /var/log/apache/mod_slog_sql_preserve.sql", but with
Apache2 it should be "LogSQLPreserveFile
/var/log/apache2/mod_slog_sql_preserve.sql".

Reproducible: Always
Steps to Reproduce:
1. Install the package.
2. Take a look at the default configuration file.
Actual Results:  
The mod doesn't work/doesn't work properly.

Expected Results:  
It should be configured correctly and work. :)

------- Comment #1 From Luca Longinotti 2005-02-18 13:52:07 0000 -------
Ok, examining further the config files I also found a typo in the Apache1
config file, it's "LoadModule log_sql_mysql_module
extramoudles/mod_log_sql_mysql.so" in the file, but it should be "LoadModule
log_sql_mysql_module extramodules/mod_log_sql_mysql.so". To help I'll attach
the two rewritten config files. Also in mod_log_sql-1.100.ebuild change line 20
from:
APACHE2_MOD_CONF="${PV}/10_${PN}"
to:
APACHE2_MOD_CONF="${PV}/10_${PN}_apache2"
and then also that should work.

------- Comment #2 From Luca Longinotti 2005-02-18 13:52:58 0000 -------
Created an attachment (id=51548) [details]
Rewritten config files.

------- Comment #3 From Luca Longinotti 2005-02-18 14:11:23 0000 -------
Oups, two little errors in my previous postings:
1) It's not line 20, but line 21.
2) I forgot to mention that you also need to create a config file for Apache2 in the files/1.100/ directory if you use that modify, so you'll end up with:
files/10_mod_log_sql.conf
files/10_mod_log_sql_apache2.conf
files/1.100/10_mod_log_sql.conf
files/1.100/10_mod_log_sql_apache2.conf
The 10_mod_log_sql.conf and 10_mod_log_sql_apache2.conf are both the same as mine, and I tried it and it works.

------- Comment #4 From Luca Longinotti 2005-02-19 05:26:35 0000 -------
Ahh another oups! :) For the files/1.100/10_mod_log_sql*.conf you have to
change the LoadModule directives paths from extramodules/ to modules/, then it
will work perfectly fine (atm it's logging my webserver, so it does! :D ).

------- Comment #5 From Benedikt Böhm 2005-02-20 15:12:22 0000 -------
> 1) There is no mention of the LogSQLLoginInfo directive

added

> 3) "LogSQLCreateTables on" is there two times

fixed

> 4) With the new 1.100 version in portage, done with the new Apache ebuild classes, I noticed that also if you use Apache2, the config files is always /usr/portage/net-www/mod_log_sql/files/10_mod_log_sql.conf, and not 10_mod_log_sql_apache2.conf like it should be

It shouldn't

> thus you get a config file with "LogSQLPreserveFile /var/log/apache/mod_slog_sql_preserve.sql", but with Apache2 it should be "LogSQLPreserveFile /var/log/apache2/mod_slog_sql_preserve.sql".

fixed by using relative path information in mod_log_sql.conf

i reviewed and completely redid mod_log_sql.conf it's clean now and provides good default behaviour