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

[cobalt-users] Webalizer pkg not creating stats directories for new sites



Hi all,

Have a big problem with the new webalizer package from pkgmaster.com. I upgraded to the new package, and since I did, it no longer makes "stats" directories for new virtual sites. It will update the stats for the existing sites, but for some reason it doesn't make the new stats dirs in the new virtual sites.

The new webalizer package puts the stats in /home/sites/sitexx/web/stats, but I changed it to /home/sites/sitexx/users/stats/web in the /etc/cron.daily/webalizer.pl file.

Any suggestions on why it isn't making the new stats directories? I searched the archives and found a similar problem but no resolution.

I get this in the admin email box everyday:

-----------------------------------------------------------------------------------------------------------------------------
Date: Tue, 18 Jun 2002 06:12:15 -0700
From: root (Cron Daemon)
To: root
Subject: Cron <root@ns3> run-parts /etc/cron.daily

Error: Can't change directory to /home/sites/www.yourcompany.com/users/stats/web chown: /home/sites/www.yourcompany.com/users/stats/web: No such file or directory
------------------------------------------------------------------------------------------------------------


And here is a clipping out of the webalizer.pl file, with the suspect code for making the new directories:

------------------------------------------------------------------------------------------------------------
# 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/users/stats/web";

    # 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;
    }

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

Any help would be appreciated.

Thanks!

Cody Watkins