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
  #31  
Old 26th January 2006, 06:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Please put this right before line 161 in the webalizer.php script:
PHP Code:
print_r($directory_array)."\n";
print_r(dir_array($dir."/".$filename))."\n"
so it reads:

PHP Code:
...
function 
dir_array($dir){
  if (
$dirstream = @opendir($dir)) {
    while (
false !== ($filename readdir($dirstream))) {
      if (
$filename!="." && $filename!=".."){
        if (
is_file($dir."/".$filename) && !is_link($dir."/".$filename)){
          
$directory_array[$dir."/".$filename] = filemtime($dir."/".$filename);
        }
        
print_r($directory_array)."\n";
        
print_r(dir_array($dir."/".$filename))."\n";
        if (
is_dir($dir."/".$filename)) $directory_array array_merge($directory_arraydir_array($dir."/".$filename));
      }
    }
  }
  
closedir($dirstream);
  
clearstatcache();
  return 
$directory_array;
}
... 
Then run the script again. What's the output?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Sponsored Links
  #32  
Old 26th January 2006, 19:39
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
Default

Ran it once, and got loads of errors. I ran it again, this time after removing the localhost link and web0 directory, and got far fewer errors:

[/home/www/web49/log/2006/01/web.log] => 1138299739
)

Warning: closedir(): supplied argument is not a valid Directory resource in /root/ispconfig/scripts/shell/webalizer.php on line 167

Warning: array_merge(): Argument #1 is not an array in /root/ispconfig/scripts/shell/webalizer.php on line 163

Warning: array_merge(): Argument #1 is not an array in /root/ispconfig/scripts/shell/webalizer.php on line 163

Warning: array_merge(): Argument #2 is not an array in /root/ispconfig/scripts/shell/webalizer.php on line 163


But the log files are still much bigger than they should be, so it isn't trimming them.

Last edited by hairydog2; 28th January 2006 at 00:13.
Reply With Quote
  #33  
Old 27th January 2006, 19:27
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
Default

Any ideas?
Reply With Quote
  #34  
Old 29th January 2006, 21:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Can you find out which arguments are given to the array_merge function in /root/ispconfig/scripts/shell/webalizer.php on line 163? You can do this by using print_r() statements.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #35  
Old 29th January 2006, 23:28
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by falko
Can you find out which arguments are given to the array_merge function in /root/ispconfig/scripts/shell/webalizer.php on line 163? You can do this by using print_r() statements.
I'm not sure that I can.

Line 163 is what was line 161 before I put in the two lines you suggested. I'd have thought that these would have already told us the arguments, but they don't seem to do that.

If there is another print_r() line I could usefully add, I'm happy to try it!
Reply With Quote
  #36  
Old 1st February 2006, 16:36
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
Default

With luck, this will now be less of an urgent issue. I can delete all the January logs, so I'll get some space back.
Reply With Quote
  #37  
Old 6th February 2006, 09:49
ddelbia ddelbia is offline
Member
 
Join Date: Dec 2005
Posts: 56
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have the same problem, I had to gzip January log to free space.
I defined log size with a maximum of 30%, as default.
Reply With Quote
  #38  
Old 6th February 2006, 10:58
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
Default

I'm using logrotate and cron to try and keep logs under control. I deleted January manually.
Reply With Quote
  #39  
Old 28th March 2006, 11:27
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,235
Thanks: 69
Thanked 21 Times in 17 Posts
Default

I tried modifying the webalizer.php like described above and here are the more detailed errors:

Quote:
Warning: closedir(): supplied argument is not a valid Directory resource in /root/ispconfig/scripts/shell/webalizer.php on line 167
Array
(
[/var/www/web2/log/2006/03/web.log] => 1143070222
)
Array
(
[/var/www/web2/log/2006/03/web.log] => 1143070222
)
Warning: closedir(): supplied argument is not a valid Directory resource in /root/ispconfig/scripts/shell/webalizer.php on line 167

Warning: array_merge(): Argument #1 is not an array in /root/ispconfig/scripts/shell/webalizer.php on line 163

Warning: array_merge(): Argument #2 is not an array in /root/ispconfig/scripts/shell/webalizer.php on line 163

Warning: closedir(): supplied argument is not a valid Directory resource in /root/ispconfig/scripts/shell/webalizer.php on line 167
any ideas what I can do to recover / process those logs?
Reply With Quote
  #40  
Old 28th March 2006, 12:01
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by Tenaka
any ideas what I can do to recover / process those logs?
As far as I recall, the basic problem I was having was that requests for unknown domains were beng split out to a localhost log directory. I think I got round this by creating a localhost directory that isn't under the www directory tree and putting a symlink to that instead of the localhost directory.

That means that the logfile splitting process has somewhere to put the logs, but the webalizer process doesn't look at the results. It seems to work for me, but I can't access the site from where I am today, so I'm writing from hazy memory.
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


All times are GMT +2. The time now is 01:37.


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