Bill,
I've attached 2 txt file's Remind to make a backup of the two existing files
that are located on the same place
blueonyx usr_bin_webalizer.pl = located in /usr/bin/ and is called
webalizer.pl
It runs daily it checks it the directory exists if not creates them. And it
creates an htaccess file based on IP so a site administrator without
BlueOnyx access can add their own IP.
BlueOnyx usr_sausalito_ui_web_base_sitestats_webalizer.php.txt is located in
/usr/Sausalito/ui/web/base/sitestats and is called webalizer.php
This change the location so admins that have access to the BlueOnyx control
panel still can see the stats.
With regards,
Patrick
From: blueonyx-boun...@mail.blueonyx.it
[mailto:blueonyx-boun...@mail.blueonyx.it] On Behalf Of Bill Hicks
Sent: donderdag 31 mei 2012 13:58
To: BlueOnyx General Mailing List
Subject: [BlueOnyx:10686] Website Statistics
Is there a link I can give a client for sites on BO 5106 that will let them
see their website statistics (webalizer) without giving them the link to the
site admin? On the Raq I used www.domainname.com/stats and it had an
htaccess / htpasswd login - would like the same on the BO (or similar) where
they sign in and only see the stats.
Bill Hicks
getAllowed('adminUser') &&
!($helper->getAllowed('siteAdmin') &&
$group == $helper->loginUser['site'])) {
header("location: /error/forbidden.html");
return;
}
$factory =&
$helper->getHtmlComponentFactory('base-ssl','/base/ssl/siteSSL.php');
$cce =& $helper->getCceClient();
$page = $factory->getPage();
$i18n =& $factory->getI18n();
if (!$file || ereg("./", $file) || (!ereg(".png$", $file) && !ereg(".html$",
$file)) )
{
$file = "index.html";
}
if ($group)
{
if ($group != 'server') {
list($oid) = $cce->find('Vsite', array('name' => $group));
$vsite_info = $cce->get($oid);
$fqdn = $vsite_info['fqdn'];
$fullPath = "/home/sites/" . $vsite_info['fqdn'] . "/web/stats/" .
$file;
} else {
if (is_dir("/var/www/html/usage")) {
$fullPath = "/var/www/html/usage/" . $file;
} else {
$fullPath = "/var/www/usage/" . $file;
}
}
} else {
print "Page not Found";
exit;
}
if (preg_match('/html/', $file)) {
print $page->toHeaderHtml();
}
if (file_exists($fullPath)){
$fp = fopen ($fullPath, "r");
$data = "";
while(!feof($fp))
{
$string = fgets($fp, 4096);
$string=str_replace("Page not Found" . $fullPath;
}
if (preg_match('/html/', $file)){
print $page->toFooterHtml();
}
exit ();#!/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.
#
use Time::localtime;
# 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 = "$webpath/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;
}
if (!-e $thepath."/.htaccess")
{
open (STATSHTACCESS, ">$thepath/.htaccess");
print STATSHTACCESS "order deny,allow\n";
print STATSHTACCESS "deny from all\n";
print STATSHTACCESS "allow from 192.168.\n";
close (STATSHTACCESS);
chmod 0775, "$thepath/.htaccess";
chown 0, $gid, $thepath."/.htaccess";
}
if ( -e $prefix."/".$asite."/logs/web.log"){
# Now just run webalizer
$messages .= `/usr/bin/webalizer -p -n $asite -s $asite -r $asite -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 apache:$name $thepath`;
} else {
$messages .= `echo "Frontpage ENABLED on $webpath"`;
$messages .= `chown -R nobody:$name $thepath`;
}
}else{
$message .= "No log file for: " . $asite ."\n";
}
}
}
open(BOOK, ">>/home/webalizer.log");
print BOOK $messages;
close(BOOK);
exit 0;
___
Blueonyx mailing list
Blueonyx@mail.blueonyx.it
http://mail.blueonyx.it/mailman/listinfo/blueonyx