From cd796704387139c4c4195b5bfc150c311afbd827 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 29 Nov 2010 07:44:24 +0000 Subject: [PATCH] fix for awstats aliases if the customerdocroot is equal to the domaindocroot --- .../jobs/cron_tasks.inc.http.10.apache.php | 9 +++++++++ .../jobs/cron_tasks.inc.http.20.lighttpd.php | 9 +++++++++ scripts/jobs/cron_tasks.inc.http.30.nginx.php | 20 +++++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index ad118919..a747b311 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -504,6 +504,15 @@ class apache $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n"; } } + // if the docroots are equal, we still have to set an alias for awstats + // because the stats are in /awstats/[domain], not just /awstats/ + // also, the awstats-icons are someplace else too! + // -> webalizer does not need this! + elseif($this->settings['system']['awstats_enabled'] == '1') + { + $stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n"; + $stats_text.= ' Alias /awstats-icon "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '"' . "\n"; + } } return $stats_text; diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 641bc6dd..22664ce6 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -860,6 +860,15 @@ class lighttpd $stats_text.= ' alias.url = ( "/webalizer/" => "'.makeCorrectFile($domain['customerroot'] . '/webalizer').'" )' . "\n"; } } + // if the docroots are equal, we still have to set an alias for awstats + // because the stats are in /awstats/[domain], not just /awstats/ + // also, the awstats-icons are someplace else too! + // -> webalizer does not need this! + elseif($this->settings['system']['awstats_enabled'] == '1') + { + $stats_text.= ' alias.url = ( "/awstats/" => "'.makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']).'" )' . "\n"; + $stats_text.= ' alias.url = ( "/awstats-icon" => "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '" )' . "\n"; + } } return $stats_text; diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 02a635b7..def720ed 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -633,15 +633,19 @@ class nginx $stats_text.= "\t" . '}' . "\n"; } - }else + } + // if the docroots are equal, we still have to set an alias for awstats + // because the stats are in /awstats/[domain], not just /awstats/ + // also, the awstats-icons are someplace else too! + // -> webalizer does not need this! + elseif($this->settings['system']['awstats_enabled'] == '1') { - //link the awstats icons for use in the static pages. - if($this->settings['system']['awstats_enabled'] == '1') - { - $stats_text.= "\t" . 'location /awstats-icon {' . "\n"; - $stats_text.= "\t\t" . 'alias ' . makeCorrectDir($this->settings['system']['awstats_icons']) . ';' . "\n"; - $stats_text.= "\t\t" . '}' . "\n"; - } + $stats_text.= "\t" . 'location /awstats {' . "\n"; + $stats_text.= "\t\t" . 'alias ' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . ';' . "\n"; + $stats_text.= "\t" . '}' . "\n"; + $stats_text.= "\t" . 'location /awstats-icon {' . "\n"; + $stats_text.= "\t\t" . 'alias ' . makeCorrectDir($this->settings['system']['awstats_icons']) . ';' . "\n"; + $stats_text.= "\t\t" . '}' . "\n"; } }