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

[no subject]



What I have done is take the original package for a RaQ and modified it to
install on a RaQ3/4. I have run this on and tested only on a RaQ4r. I have
also made mods to the webalizer.pl script so that the stats are actually
stored (by default) in the main site (home/sites/home/web) in a folder for
each FQDN that stats are being run for. So the logs are still being read
from the individual websites, and only the stats are being created in a
separate place. This will only work if your main site does not have FPExt
enabled of course. 

You (or the customer) can access stats by going to the main site like this
(example only):

http://www.mycobaltdomain.com/www.customersite.com

and will be prompted for the siteadmin username and password (or cobalt
admin, since he is in all groups). Once you enter it, the webalizer stats
come up for that site.

I also manually put a .htaccess in the web folder that requires admin access
so that no one can list the folder. This way the Cobalt admin can go to
http://www.mycobaltdomain.com and login and see all the sites listed and
just click on one of them to see stats. This way nobody can see all of your
domains listed.

As an option, you can edit the webalizer.pl script located in the
/etc/cron.daily directory and change the site used to not be the main site.
In this case, create a site lets say stats.mycobaltdomain.com and a DNS
pointer, and in the webalizer.pl script change 'home' to 'sitex' where x is
the stat site. You can do an ls -la of /home/sites to find out which one is
the number of the stat site you created.

Please let me know if this works for you.

I suggest method 2 which creates a stat site. The drawback is you need to
edit webalizer.pl. If you are ok with it in your home site, you just install
the package and wait for cron to run or force it to run and check stats.

I have also tried to modify the webalizer V2 .pkg out there, but am getting
problems with the version of lib-gd missing some png call or something when
the webserver starts up. If I revert back to the V1, it works OK. I have
another post on this problem.

Here are some advantages:

O Avoid the FP fiasco by placing the stats in a common non FP site.
O Bill for providing the customer access to this by having the webalizer.pl
do a check in another config file to see if that customer is paying for the
option.
O Have Cobalt admin be able to see all sites stats without having to know
the webmaster password for FP sites.

Drawbacks:

O Extra Virtual site used
O Messy URL to access stats

Here is my modified webalizer.pl file.

Later...

==========================================================================

#!/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
#
# Change: 01/25/01 - John Violette jrv@xxxxxxxxxx
# Change the location of the stat files for each site to be saved
# in the home site under a directory with the same name as the FQDN
# of the site. Make sure the home site does not use FrontPage Extn.
# You can create a 'Stat Site' and use a different site than the home
# site. Just change the 'site1' below to the required site and set up
# DNS. Each user will have to login using their site admin to see their
# stats even though they are all stored in the 'Stat Site'.
#

# 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";
    #No longer used
    $thepath = "$prefix/$asite/web/stats";
    #Place in the 'Stat Site' change site1 to whatver site
    $statpath = "$prefix/site1/web/$asite";

    # 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 $statpath)
    {
       mkdir $statpath, 775; 
       chown 0, $gid, $statpath;
       chmod 0755, $statpath;
    }

    # Create a .htaccess if it isn't there yet
    if (!-e '$statpath/.htaccess')
    {
       my $string = "#Access file\norder allow,deny\nallow from all\nrequire
group $name\nAuthname WebStats\nAuthtype Basic";
       open HTACCESS, qq(>$statpath/.htaccess);
       print HTACCESS $string;
       close HTACCESS;
       chmod 0744, qq($statpath/.htaccess);
    }

    # Now just run webalizer
    $messages .=
       `webalizer -n $asite -s $asite -r $asite -q -T -o $statpath
$prefix/$asite/logs/web.log`;
    # Now change ownership of stats files for siteadmin
    $messages .= `chown -R httpd:$name $statpath`;
  }
}

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





-----Original Message-----
From: John Violette 
Sent: Thursday, February 01, 2001 11:29 AM
To: John Violette
Subject: [cobalt-users] Webalizer with FrontPage - Need a package


I have an RAQ4i. I'm attempting to get webalizer working. I also use
FrontPage on most of my sites. I'm trying to find a webalizer package that
won't create problems with FrontPage.

I used the pkg posted on Cobalt's site and that is creating problems with
FrontPage. (FrontPage extensions are broken every night after webalizer
runs)

I read on here the other night a post from someone who was even offering to
sell one that works and install it but I can't find it anymore.

If anyone has or knows where I can find a good working pkg of webalizer that
will run with FrontPage please let me know. I would prefer the 2.x version
of webalizer if possible.

Thanks for your assistance!