- 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

@@ -342,7 +342,7 @@ if(isFroxlorVersion('0.9.3-svn2'))
{ {
showUpdateStep("Updating from 0.9.3-svn2 to 0.9.3-svn3", false); showUpdateStep("Updating from 0.9.3-svn2 to 0.9.3-svn3", false);
showUpdateStep("Correcting cron start-times"); showUpdateStep("Correcting cron start-times");
// set specific times for some crons (traffic only at night, etc.) // set specific times for some crons (traffic only at night, etc.)
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); $ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';"); $db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");

View File

@@ -254,7 +254,8 @@ return Array(
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'commands' => Array( 'commands' => Array(
'apt-get install awstats' 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/'
), ),
'files' => Array( 'files' => Array(
'etc_awstats.model.conf' => '/etc/awstats/awstats.conf' 'etc_awstats.model.conf' => '/etc/awstats/awstats.conf'

View File

@@ -248,7 +248,8 @@ return Array(
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'commands' => Array( 'commands' => Array(
'apt-get install awstats' 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/'
), ),
'files' => Array( 'files' => Array(
'etc_awstats.model.conf' => '/etc/awstats/awstats.model.conf' 'etc_awstats.model.conf' => '/etc/awstats/awstats.model.conf'

View File

@@ -255,7 +255,8 @@ return Array(
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'commands' => Array( 'commands' => Array(
'apt-get install awstats' 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/'
), ),
'files' => Array( 'files' => Array(
'etc_awstats.model.conf' => '/etc/awstats/awstats.conf' 'etc_awstats.model.conf' => '/etc/awstats/awstats.conf'

View File

@@ -32,8 +32,26 @@ function awstatsDoSingleDomain($domain, $outputdir)
safe_exec('mkdir -p ' . escapeshellarg($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."')"); $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', * 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') 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 else
{ {