
26th January 2006, 06:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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_array, dir_array($dir."/".$filename)); } } } closedir($dirstream); clearstatcache(); return $directory_array; } ...
Then run the script again. What's the output?
|

26th January 2006, 19:39
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
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.
|

27th January 2006, 19:27
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
Any ideas?
|

29th January 2006, 21:39
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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.
|

29th January 2006, 23:28
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
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!
|

1st February 2006, 16:36
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
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.
|

6th February 2006, 09:49
|
|
Member
|
|
Join Date: Dec 2005
Posts: 56
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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.
|

6th February 2006, 10:58
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
I'm using logrotate and cron to try and keep logs under control. I deleted January manually.
|

28th March 2006, 11:27
|
|
Senior Member
|
|
Join Date: Sep 2005
Posts: 1,186
Thanks: 60
Thanked 13 Times in 11 Posts
|
|
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?
|

28th March 2006, 12:01
|
|
Senior Member
|
|
Join Date: Oct 2005
Posts: 192
Thanks: 9
Thanked 1 Time in 1 Post
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 03:06.
|
|
Recent comments
21 hours 19 min ago
1 day 4 hours ago
1 day 7 hours ago
1 day 9 hours ago
1 day 17 hours ago
2 days 3 hours ago
2 days 4 hours ago
2 days 7 hours ago
2 days 12 hours ago
2 days 12 hours ago