Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 23rd February 2009, 23:09
t-mug t-mug is offline
Member
 
Join Date: Jun 2007
Posts: 70
Thanks: 11
Thanked 6 Times in 5 Posts
Default logs.php (ISPConfig 2.x)

For some reason the logs.php script has stopped working via cron on my ISPConfig 2.x server about 35 days ago. It was my mistake - but how can I roll the left bunch of log files within the /var/log/httpd/ folder into the statistics so that all webalizer and db data are up to date again?

I've visited the logs.php and it seems to me that a loop over the orphaned files could solve this, but please let me ask some short questions before I do so:
* have I to keep the exact date order of processing log files by a temorarily modified logs.php? I mean: is it possible to process older log files after new ones without making things worse?
* Are there any side effects by running a modified logs.php?

If not, I would do this:
* at the top of the temporary modified logs.php setting up these lines for running the file once for each left date log:
Code:
$mydate = '2009_01_25';
$myyear = '2009';
$mymonth = '01';
$myday = '25';
$monat_jahr = "$mymonth/$myyear";
$current_time = mktime(0,30,0,$mymonth,$myday+1,$myyear); // written to `datum` field in the isp_traffic table
* then changing the following lines:
Code:
$access_log = $server["server_path_httpd_log"] . "_" . date("Y_m_d",time() - 43200);
...
$tag = date("d", (time() - 43200));
$monat = date("m", (time() - 43200));
$jahr = date("Y", (time() - 43200));
...
$monat_jahr = date("m/Y", (time() - 43200));
$current_time = time();
...
@unlink($server["server_path_httpd_log"] . "_" . date("Y_m_d",time() - (43200 * 3)));
to the variable set at the top and comment out some lines:
Code:
$access_log = $server["server_path_httpd_log"] . "_" . $mydate);
...
$tag = $myday;
$monat = $mymonth;
$jahr = $myyear;
...
//$monat_jahr = date("m/Y", (time() - 43200));
//$jahr = date("Y", (time() - 43200));
//$current_time = time();
...
// delete files by hand later if all went well:
//@unlink($server["server_path_httpd_log"] . "_" . date("Y_m_d",time() - (43200 * 3)));
Any hints for me to consider? And: how to run the webalizer script afterwards - after each lost day??
Thanks in advance.

Last edited by t-mug; 24th February 2009 at 11:55.
Reply With Quote
Sponsored Links
  #2  
Old 24th February 2009, 09:36
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,573
Thanks: 792
Thanked 4,980 Times in 3,901 Posts
Default

You hasve to keep the xact order of files, otherwise webalizer wont process the log correctly. In general your solution should work but I've not tested it.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 24th February 2009, 10:11
t-mug t-mug is offline
Member
 
Join Date: Jun 2007
Posts: 70
Thanks: 11
Thanked 6 Times in 5 Posts
Default

Thanks for your reply.

Quote:
Originally Posted by till View Post
You hasve to keep the xact order of files, otherwise webalizer wont process the log correctly. In general your solution should work but I've not tested it.
So I did it well and have not yet enabled the daily mechanism again.

Do I have to run webalizer.php each time after running the modified logs.php for a special past day? I've seen, this is the usual way: some hours after running the logs.php script cron runs the webalizer.php script daily. I've not understood the webalizer script so far - would be nice to know wheter this is necessary or not.

Thanks again for your support.
Reply With Quote
  #4  
Old 24th February 2009, 10:15
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,573
Thanks: 792
Thanked 4,980 Times in 3,901 Posts
Default

Nió, its enough to run webalizer once when all logs ahve been processed.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 24th February 2009, 11:56
t-mug t-mug is offline
Member
 
Join Date: Jun 2007
Posts: 70
Thanks: 11
Thanked 6 Times in 5 Posts
 
Default All fine

Thank you again. All went fine this way.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL5 client access to ISPConfig box vs plain centos5 pakogah Installation/Configuration 1 5th August 2008 18:47
ISPConfig 2.2.14 released till General 48 19th July 2007 23:46
Migrating from Virtualmin to ISPConfig xare Installation/Configuration 3 16th July 2006 12:58
ISPConfig 2.3.1-dev released till General 0 8th May 2006 22:18
SP-Server Setup - Ubuntu 5.10 "Breezy Badger" - Page 6 (changes) LuisC-SM HOWTO-Related Questions 0 21st April 2006 15:16


All times are GMT +2. The time now is 19:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.