Skip to content

Commit 320e4e8

Browse files
committed
Added missing aliasdomains in awstats config file.
1 parent 2307971 commit 320e4e8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

server/cron_daily.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,21 @@ function setConfigVar( $filename, $varName, $varValue ) {
177177

178178
if(is_file($awstats_website_conf_file)) unlink($awstats_website_conf_file);
179179

180+
$sql = "SELECT domain FROM web_domain WHERE (type = 'alias' OR AND type = 'subdomain') server_id = ".$conf['server_id'];
181+
$aliases = $app->db->queryAllRecords($sql);
182+
$aliasdomain = '';
183+
184+
if(is_array($aliases)) {
185+
foreach ($aliases as $alias) {
186+
$aliasdomain.= ' '.$alias['domain']. ' www.'.$alias['domain'];
187+
}
188+
}
189+
180190
if(!is_file($awstats_website_conf_file)) {
181191
$awstats_conf_file_content = 'Include "'.$awstats_conf_dir.'/awstats.conf"
182192
LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log"
183193
SiteDomain="'.$domain.'"
184-
HostAliases="www.'.$domain.' localhost 127.0.0.1"';
194+
HostAliases="www.'.$domain.' localhost 127.0.0.1"'.$aliasdomain;
185195
file_put_contents($awstats_website_conf_file,$awstats_conf_file_content);
186196
}
187197

0 commit comments

Comments
 (0)