[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] raq4 webalizer



Hi, Gary.

I've got one quick question for you: did you install the version available from the "official" Webalizer site (http://www.mrunix.net/webalizer/), or did you download it from another source? If so, where?

Thanks!

Jarrod

---------------------------------------------------------
Jarrod Igou
Worldwide Systems Integrator
Kemin Industries, Inc.
jigou@xxxxxxxxx
515.248.4033

>>> "Gary Peltola - Web Hosting Network" <clist@xxxxxxxxxxxxxxx> 12/13/00 03:29PM >>>
Hi Everyone

I have a RAQ4, installed the webalizer package, and yet again, my users are
getting "Cannot change permissions on
file"/home/sites/site5/web/stats/usage_200012.html"

How do i change the /etc/cron.daily/webalizer.pl owner to nobody? I have
enclosed my pl file

Do I change : chown 0, $gid, $thepath
to this: chown nobody, $gid, $thepath

??
Thanks
Gary

---------------


#!/usr/bin/perl

# File: webalizer.pl 7.18.2000 Stew Smith <stew@xxxxxxxxxx>
#
# 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.
#
# CHANGE: added -s and -r flags to the webalizer command that is run.
# This tells webalizer to ignore the virtual server's own address
# in the top sites and top referrers reports.  Also chown'ed the
# files created after webalizer is run to allow siteadmin's to manage
# the stats via ftp or frontpage.
# Courtesy of David Thacker
#

# Where sites on a RaQ3 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";
       open HTACCESS, qq(>$thepath/.htaccess);
       print HTACCESS $string;
       close HTACCESS;
       chmod 0744, qq($thepath/.htaccess);
    }

    # Now just run webalizer
    $messages .=
       `webalizer -n $asite -s $asite -r $asite -q -T -o $thepath
$prefix/$asite/logs/web.log`;
    # Now change ownership of stats files for siteadmin
    $messages .= `chown -R httpd:$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;



_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx 
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users