[Mod_log_sql] mod_log_sql help confgiuring on debian etch

Thomas Goirand thomas at goirand.fr
Sat Oct 27 23:19:38 EDT 2007


If you wish, you can use our script, but it will need a bit of rewrite
if you are not using our control panel. What it does is that it parses
the domain and subdomain tables, then dump the logs with one file per
day. Then it sends the log to be used by webalizer/visitors/awstats.

Here's the link on our gitweb:

http://git.gplhost.com/gitweb/?p=dtc.git;a=blob;f=admin/accesslog.php;h=fa5f2f82092af975c8f141f9e72bcd99a2a901f1;hb=4890ab615d59e935e17f1458aa2a5a5d60a71b77

I hope that helps and that you will be able to adapt it for your needs.

Thomas

Peter wrote:
> Hi Chris
> I'm glad you got it going.
> 
> No the tales grow and grow:) If you write a script to dump (backup) and
> purge please send it to me. I'd like something to do that
> automatically. 
> 
> Cheers,
> Peter
> 
> On Sat, 2007-27-10 at 13:19 -0600, Chris wrote:
>> Question - does the package auto purge the table at the end of the month or
>> do I need to script this myself?
>>
>> -----Original Message-----
>> From: mod_log_sql-bounces at lists.outoforder.cc
>> [mailto:mod_log_sql-bounces at lists.outoforder.cc] On Behalf Of Chris
>> Sent: Saturday, October 27, 2007 1:18 PM
>> To: 'General mod_log_sql discussion'
>> Subject: Re: [Mod_log_sql] mod_log_sql help confgiuring on debian etch
>>
>> Thank god I don't suck.  I logged into phpMyAdmin as apachelog and was not
>> able to create table.  So I granted that priv to apachelog and it
>> auto-created the apachelog table and now I have logs in there.  Sweet!
>> Thanks a ton for your help!
>>
>> You have no idea how much CPU and Mem this will save me.  I wrote a script
>> in PHP that parses the access.log file for various information I need,
>> particularly how much bandwidth my users use and it consistently maxes out
>> my memory consuming over 500 MB for some of the arrays it needs to build,
>> not too mention killing my CPU.
>>
>> Thanks again.
>>
>> -----Original Message-----
>> From: mod_log_sql-bounces at lists.outoforder.cc
>> [mailto:mod_log_sql-bounces at lists.outoforder.cc] On Behalf Of Peter
>> Sent: Saturday, October 27, 2007 12:52 PM
>> To: General mod_log_sql discussion
>> Subject: Re: [Mod_log_sql] mod_log_sql help confgiuring on debian etch
>>
>> Chris
>>
>> You do have a db apachelogs? 
>> Does the user apachelog have "SELECT, INSERT, UPDATE, CREATE"
>> privileges?
>> Did you check to see if the table access_mp3crib.com was created? 
>> Do have both log_sql and log_sql_mysql installed and loaded?
>>
>> Is anything being written to the sql-preserve file?
>>
>> I can't think on anything else off the top of my head.
>>
>> Peter
>>
>> On Sat, 2007-27-10 at 12:38 -0600, Chris wrote:
>>> Here is what I have on httpd.conf now where apachelog is the user,
>>> password is the password and apachelogs in the database.  I have
>>> flushed the db and turned on LogSQLCreateTables.  When I reload the
>>> config my browser simply sits on connecting when I point it at my
>>> domain.
>>>
>>>  
>>>
>>> LogSQLLoginInfo mysql://apachelog:password@localhost/apachelogs
>>>
>>> LogSQLSocketFile /var/run/mysqld/mysqld.sock
>>>
>>> LogSQLCreateTables On
>>>
>>> LogSQLMassVirtualHosting Off
>>>
>>> LogSQLMachineID kernel
>>>
>>> LogSQLPreserveFile /var/tmp/sql-preserve
>>>
>>>  
>>>
>>> I have the following parameters in my vhost
>>> file /etc/apache2/sites-enabled/000-default
>>>
>>>  
>>>
>>>         LogSQLTransferLogTable access_mp3crib.com
>>>
>>>         LogSQLScoreDomain mp3crib.com
>>>
>>>  
>>>
>>> For the LogSQLPreserveFile I ran this command mysql -
>>> root -p mydbname < /var/tmp/sql-preserve to ensure it is in a writable
>>> directory and the file is writable.  Not exactly sure if the
>>> parameters in the vhost file are correct.  My web server still
>>> functions properly if I comment out the LogSQLLoginInfo and
>>> LogSQLPreserveFile params in httpd.conf file and yes I did verify the
>>> password is correct for the mysql user.  I was hoping this was going
>>> to be easy, but I should've known otherwise when I turned to Sid for
>>> the package.
>>>
>>>  
>>>
>>> -----Original Message-----
>>> From: mod_log_sql-bounces at lists.outoforder.cc
>>> [mailto:mod_log_sql-bounces at lists.outoforder.cc] On Behalf Of Peter
>>> Sent: Saturday, October 27, 2007 11:43 AM
>>> To: General mod_log_sql discussion
>>> Subject: Re: [Mod_log_sql] mod_log_sql help confgiuring on debian etch
>>>
>>>  
>>>
>>> Hi
>>>
>>>  
>>>
>>> It took me awhile to get it running on Etch.
>>>
>>>  
>>>
>>> You need to have log_sql and log_sql_mysql loaded. I created a user to
>>>
>>> access my db with create rights so the tables would be created. This
>>>
>>> seems to work better then creating the tables yourself. At least the
>>>
>>> fields will be correct you can turn off LogSQLCreateTables later. You
>>>
>>> also need to make sure you have mod_log_sql-preserve in a writable
>>>
>>> directory. Check there for errors.
>>>
>>>  
>>>
>>> Your http.conf is blank be default. I added:
>>>
>>>  
>>>
>>> LogSQLLoginInfo mysql://loguser:username@localhost/apachelogs
>>>
>>> LogSQLDBParam socketfile /var/run/mysqld/mysqld.sock
>>>
>>> LogSQLCreateTables On
>>>
>>> LogSQLMassVirtualHosting Off
>>>
>>> LogSQLMachineID web
>>>
>>>  
>>>
>>>  
>>>
>>> In vhost setup I used:
>>>
>>>  
>>>
>>>       LogSQLTransferLogTable access_vhost_name_com
>>>
>>>       LogSQLScoreDomain vhost_name.com
>>>
>>>  
>>>
>>> Good luck :) 
>>>
>>>  
>>>
>>> On Sat, 2007-27-10 at 11:11 -0600, Chris wrote:
>>>
>>>> I'm trying to setup mod_log_sql to log my apache access log entries
>>> in
>>>
>>>> a mysql 5 database. I have installed mod_log_sql version 1.100 from
>>>> sid using aptitude install libapache2-mod-log-sql. 
>>>> I then created the tables using a SQL file created by the developer
>>> of
>>>
>>>> the package to create them for me. The documentation, unfortunately,
>>>> it is not debian centric and is asking me to put things in my
>>>> httpd.conf file such as:
>>>>  
>>>> Example: Use the MySQL database called "apachelogs" running on
>>>> "dbmachine.foo.com". Use username "loguser" and password "l0gg3r" to
>>>> authenticate to the database. Permit the module create tables for
>>> us. 
>>>
>>>> LogSQLLoginInfo dbmachine.foo.com loguser l0gg3r 
>>>> LogSQLDatabase apachelogs 
>>>> LogSQLCreateTables on 
>>>> If your database resides on localhost instead of another host,
>>> specify
>>>
>>>> the MySQL server's socket file as follows: 
>>>> LogSQLSocketFile /your/path/to/mysql.sock 
>>>> If your database is listening on a port other than 3306, specify the
>>>> correct TCP port as follows: 
>>>> LogSQLTCPPort 1234
>>>>  
>>>> There is no area to do this in httpd.conf really, in fact it is a
>>>> blank file since I am on apache2. Do I just add these directives in
>>>> myself? Please advise, I am using the documentation located here:
>> http://www.outoforder.cc/projects/apache/mod_log_sql/docs/node4.html#SECTION
>> 00042000000000000000
>>>> and my server is Etch based running MySQL 5 Apache 2 and yes, I did
>>>> install the mod_log_sql from the unstable repo sid. Also I did
>>> verify
>>>
>>>> the modules is in /etc/mods-enabled/ and did restart apache, but I
>>>> guess I still need to configure the module so it knows where to
>>> insert
>>>
>>>> records. I am a developer, not a sys admin, sorry, but thanks for
>>> your
>>>
>>>> help in advance.  I tried just adding the parameters to httpd.conf
>>> and
>>>
>>>> restarting apache, it restarts with no errors, but I get timeouts
>>> when
>>>
>>>> attempting to access my page.
>>>> _______________________________________________
>>>> Download the latest version at
>>> http://www.outoforder.cc/projects/apache/mod_log_sql/
>>>
>>>> To unsubscribe send an e-mail to 
>>>> mod_log_sql-unsubscribe at lists.outoforder.cc
>>>  
>>>
>>> _______________________________________________
>>>
>>> Download the latest version at
>>> http://www.outoforder.cc/projects/apache/mod_log_sql/
>>>
>>>  
>>>
>>> To unsubscribe send an e-mail to 
>>>
>>> mod_log_sql-unsubscribe at lists.outoforder.cc




More information about the Mod_log_sql mailing list