- corrected path to 'awstats_buildstaticpages.pl' under debian (note: additional configuration has been added, awstats_buildstaticpages.pl default is *not* in the correct path), #fixes 87

This commit is contained in:
Michael Kaufmann (d00p)
2010-03-24 09:58:24 +00:00
parent 15e7441ab9
commit f5e2d13c53
6 changed files with 27 additions and 6 deletions

View File

@@ -32,8 +32,26 @@ function awstatsDoSingleDomain($domain, $outputdir)
safe_exec('mkdir -p ' . escapeshellarg($outputdir));
}
/**
* check for correct paths of awstats_buildstaticpages.pl
*/
$awbsp = '/usr/bin/awstats_buildstaticpages.pl';
/**
* debian...pffff, #87
*/
if (!file_exists($awbsp)) {
$awbsp = '/usr/lib/cgi-bin/awstats_buildstaticpages.pl';
}
if (!file_exists($awbsp)) {
echo "WANRING: Necessary awstats_buildstaticpages.pl script could not be found, no traffic is being calculated and no stats are generated";
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "Necessary awstats_buildstaticpages.pl script could not be found, no traffic is being calculated and no stats are generated");
exit;
}
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '".$domain."' (Output: '".$outputdir."')");
safe_exec('awstats_buildstaticpages.pl -update -config=' . $domain . ' -dir='.escapeshellarg($outputdir));
safe_exec($awbsp.' -update -config=' . $domain . ' -dir='.escapeshellarg($outputdir));
/**
* index file is saved like 'awstats.[domain].html',

View File

@@ -167,7 +167,7 @@ while($row = $db->fetch_array($result))
if($settings['system']['awstats_enabled'] == '1')
{
$httptraffic+= floatval(callAwstatsGetTraffic($domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domainlist[$row['customerid']]));
$httptraffic+= floatval(callAwstatsGetTraffic($domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']]));
}
else
{