Skip to content

Commit e6abfe7

Browse files
author
Carsten Schoene
committed
fallback to awstats.model.conf if awstats.conf does not exist
1 parent a175927 commit e6abfe7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

server/lib/classes/cron.d/150-awstats.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ public function onRunJob() {
100100
}
101101

102102
if(!is_file($awstats_website_conf_file)) {
103-
$awstats_conf_file_content = 'Include "'.$awstats_conf_dir.'/awstats.conf"
103+
if (is_file($awstats_conf_dir."/awstats.conf")) {
104+
$include_file = $awstats_conf_dir."/awstats.conf";
105+
} elseif (is_file($awstats_conf_dir."/awstats.model.conf")) {
106+
$include_file = $awstats_conf_dir."/awstats.model.conf";
107+
}
108+
$awstats_conf_file_content = 'Include "'.$include_file.'"
104109
LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log"
105110
SiteDomain="'.$domain.'"
106111
HostAliases="www.'.$domain.' localhost 127.0.0.1'.$aliasdomain.'"';

server/plugins-available/apache2_plugin.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,12 @@ private function awstats_update ($data, $web_config) {
26262626
}
26272627

26282628
$content = '';
2629-
$content .= "Include \"".$awstats_conf_dir."/awstats.conf\"\n";
2629+
if (is_file($awstats_conf_dir."/awstats.conf")) {
2630+
$include_file = $awstats_conf_dir."/awstats.conf";
2631+
} elseif (is_file($awstats_conf_dir."/awstats.model.conf")) {
2632+
$include_file = $awstats_conf_dir."/awstats.model.conf";
2633+
}
2634+
$content .= "Include \"".$include_file\"\n";
26302635
$content .= "LogFile=\"/var/log/ispconfig/httpd/".$data['new']['domain']."/access.log\"\n";
26312636
$content .= "SiteDomain=\"".$data['new']['domain']."\"\n";
26322637
$content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n";

server/plugins-available/nginx_plugin.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,12 @@ private function awstats_update ($data, $web_config) {
22362236
}
22372237

22382238
$content = '';
2239-
$content .= "Include \"".$awstats_conf_dir."/awstats.conf\"\n";
2239+
if (is_file($awstats_conf_dir."/awstats.conf")) {
2240+
$include_file = $awstats_conf_dir."/awstats.conf";
2241+
} elseif (is_file($awstats_conf_dir."/awstats.model.conf")) {
2242+
$include_file = $awstats_conf_dir."/awstats.model.conf";
2243+
}
2244+
$content .= "Include \"".$include_file\"\n";
22402245
$content .= "LogFile=\"/var/log/ispconfig/httpd/".$data['new']['domain']."/access.log\"\n";
22412246
$content .= "SiteDomain=\"".$data['new']['domain']."\"\n";
22422247
$content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n";

0 commit comments

Comments
 (0)