errorhandling for awstats.conf / awstats.model.conf
Catch situation where no basic awstats configuration can be found
and create a warning message.
| | |
| | | LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log" |
| | | SiteDomain="'.$domain.'" |
| | | HostAliases="www.'.$domain.' localhost 127.0.0.1'.$aliasdomain.'"'; |
| | | file_put_contents($awstats_website_conf_file, $awstats_conf_file_content); |
| | | if (isset($include_file)) { |
| | | file_put_contents($awstats_website_conf_file, $awstats_conf_file_content); |
| | | } else { |
| | | $app->log("No awstats base config found. Either awstats.conf or awstats.model.conf must exist in ".$awstats_conf_dir.".", LOGLEVEL_WARN); |
| | | } |
| | | } |
| | | |
| | | if(!@is_dir($statsdir)) mkdir($statsdir); |
| | |
| | | $content .= "SiteDomain=\"".$data['new']['domain']."\"\n"; |
| | | $content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n"; |
| | | |
| | | $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); |
| | | $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); |
| | | if (isset($include_file)) { |
| | | $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); |
| | | $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); |
| | | } else { |
| | | $app->log("No awstats base config found. Either awstats.conf or awstats.model.conf must exist in ".$awstats_conf_dir.".", LOGLEVEL_WARN); |
| | | } |
| | | } |
| | | |
| | | if(is_file($data['new']['document_root']."/" . $web_folder . "/stats/index.html")) $app->system->unlink($data['new']['document_root']."/" . $web_folder . "/stats/index.html"); |
| | |
| | | $content .= "SiteDomain=\"".$data['new']['domain']."\"\n"; |
| | | $content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n"; |
| | | |
| | | $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); |
| | | $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); |
| | | if (isset($include_file)) { |
| | | $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); |
| | | $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); |
| | | } else { |
| | | $app->log("No awstats base config found. Either awstats.conf or awstats.model.conf must exist in ".$awstats_conf_dir.".", LOGLEVEL_WARN); |
| | | } |
| | | } |
| | | |
| | | if(is_file($data['new']['document_root']."/" . $web_folder . "/stats/index.html")) $app->system->unlink($data['new']['document_root']."/" . $web_folder . "/stats/index.html"); |