babak
07-27-2002, 09:00 AM
Hi
Since a week ago is my site-usage in control-panel empty!! ( for 90% of my sites). But webalizer is still working correct.
I am using raq4.
How can I fix this?
TNX
Regards,
Babak
IFAPaulB
07-27-2002, 10:39 PM
Have the logs been rotated recently?
aljuhani
07-28-2002, 02:25 AM
Hello Babak.
This happens always when you install webalizer, here is what you need to do:
copy /etc/logrotate.d/apache to /usr/local/apache
That should solve it If not I think there is a package that reslove this but I cannot remmember. Anyway try this first and see if it will re-enable the default RAQ' analog logging.
BTW RAQ's Stats updates every 4:00 am everyday.
Regards,
Al-Juhani
IFAPaulB
07-28-2002, 11:22 AM
Did both of you install Webalizer from source?
If you install the Webalizer pkg from pkgmaster.com I believe it takes care of this.
babak
07-28-2002, 11:27 AM
hi
Yes I installed webalizer from pkgmaster about 1 month ago. Evrything was ok until past few days. Since a 4/5 days the stats in site-usage in CP is emmpty. Its not a webalizer issue, but something about the log/logrotator I think
TNX.
Regards,
Babak
aljuhani
07-28-2002, 12:41 PM
Hi Babak.
The same exact thing happened with me .. then I decided to remove webalizer after that the Raq's Stats started working.
I think there is a solution. I will try to find the info I had before regarding this issue. Also you may need to check this website below for some help, more webalizer additions:
http://cobalt-aid2.lindist.dk/modules.php?op=modload&name=Downloads&file=index&req=viewsdownload&sid=7
Regards,
Al-Juhani
babak
08-02-2002, 11:28 AM
thanks al voor replays.
THIS IS NOT A WEBALIZE ISSUE!!
webalizer was installed 2month's ago.
This issue is starting about one weak ago.
Regards,
Babak
aljuhani
08-02-2002, 12:22 PM
Babak.
Here is a script for fixing RaQ3 & RaQ4, here is the procedure:
1. Copy the script to /home/sites/home, naming it as log_fix.cgi, 2. chmod the script to 755
3. su to root, cd to /home/sites/home
then type ./log_fix.cgi to start the script
the script is below:
--script starts here--
#!/usr/bin/perl
eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
$|++;
=head
RaQ3 and RQ4 errors rotating httpd access log fix
1: copy the /var/log/httpd/access log file to new location (current working
directory)
2: delete the /var/log/httpd/access log file
3: creating a new /var/log/httpd/access log file using touch
4: reset the correct file permissions on the /var/log/httpd/access log file
5: restart the web server using '/etc/rc.d/init.d/httpd restart'
6: split-up the old access log file and append the info to each of the
sites on the server.
This script must be run as root, works on RQ3 and RQ4
Upload the script to /home/sites/site1, chmod 755
login as root cd to /home/sites/site1
then type ./log_fix.cgi
Use at your own risk. The worst it can do is fix the log rotate problem,
and not append the access log hits to the virtual sites on your server.
=cut
use strict;
use Cobalt::Product;
use Cobalt::Vsite;
my $Htgroup_dir = "/home/sites";
my $Logdir = "logs";
my $access_log_file = "/var/log/httpd/access";
use Cwd;
my $working_dir = getcwd;
my $new_access_log_file = "$working_dir/access";
if( -e $new_access_log_file){
print "\ndelete the file $new_access_log_file, before running this script.\n\n";
exit 0;
}
print "\ncopying $access_log_file to $new_access_log_file\n";
system("cp $access_log_file $new_access_log_file");
print "deleteing $access_log_file\n";
unlink($access_log_file);
print "creating a new $access_log_file\n";
system("touch $access_log_file");
print "setting file permission 644 on $access_log_file\n";
chmod(02644,"$access_log_file");
print "restarting the web server\n";
system("/etc/rc.d/init.d/httpd restart");
my $in;
my $total = 0;
# Foreach site returned by vsite_list..
foreach ( vsite_list() ) {
# 0=ipaddress 1=domain 2=directory
#elements in the nested array (ip,hostname,directory)
my $site_path = $$_[2];
my $domain = $$_[1];
my $log_file = "$Htgroup_dir/$site_path/$Logdir/web.log";
open(FH,"<$new_access_log_file") or die "Could not open access log for main site: $!";
open(WEBLOG,">>$log_file") or warn "Could not open web log $log_file for $site_path site: $!";
my $i =0;
while($in =<FH>){
my ($name,$contents) = split(/ /,$in,2);
if($name =~ /$domain/){
print WEBLOG $contents;
$i++;
}
}
close FH;
close WEBLOG;
print "$domain had $i hits\n";
$total += $i;
}
print "\n$access_log_file had a total of $total hits\nall done.\n";
exit 0;
--script ends here--
If the script is not clear here, then email me on aljuhani@sbm.net.sa and I will send it to you by email.
Regards,
Al-Juhani