add 'goaccess' as new and default traffic analyzer tool

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-03 08:58:11 +01:00
parent a052333296
commit a8dc576833
27 changed files with 254 additions and 157 deletions

View File

@@ -1032,30 +1032,17 @@ class Apache extends HttpConfigBase
{
$stats_text = '';
$statTool = Settings::Get('system.traffictool');
$statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain'];
if ($domain['speciallogfile'] == '1') {
$statDomain = ($domain['parentdomainid'] == '0') ? $domain['domain'] : $domain['parentdomain'];
if (Settings::Get('system.awstats_enabled') == '1') {
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $statDomain) . '"' . "\n";
$statDomain = $domain['domain'];
}
$statDocroot = FileDir::makeCorrectFile($domain['customerroot'] . '/'.$statTool.'/' . $statDomain);
$stats_text .= ' Alias /'.$statTool.' "' . $statDocroot . '"' . "\n";
// awstats special requirement for icons
if ($statTool == 'awstats') {
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
} else {
$stats_text .= ' Alias /webalizer "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $statDomain) . '"' . "\n";
}
} else {
if ($domain['customerroot'] != $domain['documentroot']) {
if (Settings::Get('system.awstats_enabled') == '1') {
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
} else {
$stats_text .= ' Alias /webalizer "' . FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n";
}
} elseif (Settings::Get('system.awstats_enabled') == '1') {
// 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!
$stats_text .= ' Alias /awstats "' . FileDir::makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text .= ' Alias /awstats-icon "' . FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
}
}
return $stats_text;
@@ -1138,7 +1125,7 @@ class Apache extends HttpConfigBase
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
}
if (Settings::Get('system.awstats_enabled') == '1') {
if (Settings::Get('system.traffictool') == 'awstats') {
if ((int)$domain['parentdomainid'] == 0) {
// prepare the aliases and subdomains for stats config files
$server_alias = '';