[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] webalizer
- Subject: Re: [cobalt-users] webalizer
- From: "c Mcdonald" <mrdynamic70@xxxxxxxxxxx>
- Date: Wed Dec 12 01:55:01 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
The webalizer runs from cron - have a look in /etc/cron.daily
here are the entrys for my webalizer
[admin cron.daily]$ cat webalizer.cron
#!/bin/bash
# update access statistics for the web site
/usr/bin/webalizer
exit 0
[admin cron.daily]$ cat webalizer.pl
#!/usr/bin/perl
#
# This script runs webalizer for every virtual site on a Cobalt RaQ3
# machine. This depends on the configuration file /etc/webalizer.conf
# and several command-line switches including those for the LogFile and
# Hostname.
#
# PLEASE NOTE: The /stats directory created will be password protected
# allowing only site admins in for that site.
#
# Where sites on a RaQ3/4 live
$prefix = "/home/sites";
# Status messages
my $messages;
chdir "$prefix" or die "Can't cd to $prefix??: $!\n";
opendir THEROOT, $prefix or die "Couldn't open $prefix?: $!\n";
@allsites = grep !/^\.\.?$/, readdir THEROOT;
foreach $asite (@allsites)
{
if (-l "$asite")
{
$webpath = "$prefix/$asite/web";
$thepath = "$prefix/$asite/web/stats";
# Get the group id of the directory
my $gid = (stat $webpath)[5];
my $name = (getgrgid $gid)[0];
# Create a directory /web/stats if it isn't there yet
if (!-d $thepath)
{
mkdir $thepath, 775;
chown 0, $gid, $thepath;
chmod 0755, $thepath;
}
# Create a .htaccess if it isn't there yet
if (!-e '$thepath/.htaccess')
{
my $string =
"#Access file\norder allow,deny\nallow from all\nrequire group
$name\nAuthname WebStats\nAuthtype Basic\nAuthAuthoritative off\n";
open HTACCESS, qq(>$thepath/.htaccess);
print HTACCESS $string;
close HTACCESS;
chmod 0744, qq($thepath/.htaccess);
}
# Now just run webalizer
$messages .=
`webalizer -p -n $asite -s $asite -r $asite -q -Q -T -o $thepath
$prefix/$asite/logs/web.log`;
# Now change ownership of files for frontpage and non-frontpage enabled
sites
if (!-d $webpath . "/_vti_bin") {
$messages .= `echo "Frontpage NOT ENABLED on $webpath"`;
$messages .= `chown -R httpd:$name $thepath`;
} else {
$messages .= `echo "Frontpage ENABLED on $webpath"`;
$messages .= `chown -R nobody:$name $thepath`;
}
}
}
# Debugging printer, uncomment to use.
# These messages would be mailed to the box admin if you printed them
# and there actually were any.
#print $messages;
exit 0;
[admin cron.daily]$
From: "Mike " <becom@xxxxxxxxx>
Reply-To: cobalt-users@xxxxxxxxxxxxxxx
To: <cobalt-users@xxxxxxxxxxxxxxx>
Subject: [cobalt-users] webalizer
Date: Tue, 11 Dec 2001 15:35:51 -0800
I like many others had a problem with webalizer not renewing stats. I
uninstalled version 1.3
And version 2.01 and reinstalled version 1.3 but now all I get at /stats
is (file not found)
Any help would be appreciated..
Mike
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.