diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 1ce0c996..9bd5bb06 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -342,7 +342,7 @@ if(isFroxlorVersion('0.9.3-svn2')) { 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.) $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';"); diff --git a/lib/configfiles/etch.inc.php b/lib/configfiles/etch.inc.php index 2fca929a..32d27ad9 100644 --- a/lib/configfiles/etch.inc.php +++ b/lib/configfiles/etch.inc.php @@ -254,7 +254,8 @@ return Array( 'awstats' => Array( 'label' => 'Awstats', '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( 'etc_awstats.model.conf' => '/etc/awstats/awstats.conf' diff --git a/lib/configfiles/hardy.inc.php b/lib/configfiles/hardy.inc.php index 553a59e2..5609d452 100644 --- a/lib/configfiles/hardy.inc.php +++ b/lib/configfiles/hardy.inc.php @@ -248,7 +248,8 @@ return Array( 'awstats' => Array( 'label' => 'Awstats', '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( 'etc_awstats.model.conf' => '/etc/awstats/awstats.model.conf' diff --git a/lib/configfiles/lenny.inc.php b/lib/configfiles/lenny.inc.php index 63aec48d..5839f522 100644 --- a/lib/configfiles/lenny.inc.php +++ b/lib/configfiles/lenny.inc.php @@ -255,7 +255,8 @@ return Array( 'awstats' => Array( 'label' => 'Awstats', '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( 'etc_awstats.model.conf' => '/etc/awstats/awstats.conf' diff --git a/scripts/jobs/cron_traffic.inc.functions.php b/scripts/jobs/cron_traffic.inc.functions.php index d537afe1..8592d011 100644 --- a/scripts/jobs/cron_traffic.inc.functions.php +++ b/scripts/jobs/cron_traffic.inc.functions.php @@ -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', diff --git a/scripts/jobs/cron_traffic.php b/scripts/jobs/cron_traffic.php index f983eb92..a7c32f29 100644 --- a/scripts/jobs/cron_traffic.php +++ b/scripts/jobs/cron_traffic.php @@ -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 {