| | |
| | | |
| | | //* Add vhost for IPv6 IP |
| | | if($data['new']['ipv6_address'] != '') { |
| | | if ($conf['serverconfig']['web']['vhost_rewrite_v6'] == 'y') { |
| | | if (isset($conf['serverconfig']['server']['v6_prefix']) && $conf['serverconfig']['server']['v6_prefix'] <> '') { |
| | | $explode_v6prefix=explode(':', $conf['serverconfig']['server']['v6_prefix']); |
| | | //* rewrite ipv6 on mirrors |
| | | /* chang $conf to $web_config */ |
| | | if ($web_config['serverconfig']['web']['vhost_rewrite_v6'] == 'y') { |
| | | if (isset($web_config['serverconfig']['server']['v6_prefix']) && $web_config['serverconfig']['server']['v6_prefix'] <> '') { |
| | | $explode_v6prefix=explode(':', $web_config['serverconfig']['server']['v6_prefix']); |
| | | $explode_v6=explode(':', $data['new']['ipv6_address']); |
| | | |
| | | for ( $i = 0; $i <= count($explode_v6prefix)-3; $i++ ) { |
| | |
| | | } |
| | | |
| | | $content = ''; |
| | | $content .= "Include \"".$awstats_conf_dir."/awstats.conf\"\n"; |
| | | if (is_file($awstats_conf_dir."/awstats.conf")) { |
| | | $include_file = $awstats_conf_dir."/awstats.conf"; |
| | | } elseif (is_file($awstats_conf_dir."/awstats.model.conf")) { |
| | | $include_file = $awstats_conf_dir."/awstats.model.conf"; |
| | | } |
| | | $content .= "Include \"".$include_file."\"\n"; |
| | | $content .= "LogFile=\"/var/log/ispconfig/httpd/".$data['new']['domain']."/access.log\"\n"; |
| | | $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"); |
| | |
| | | $tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1); |
| | | $tpl->setVar('fpm_user', $data['new']['system_user']); |
| | | $tpl->setVar('fpm_group', $data['new']['system_group']); |
| | | $tpl->setVar('fpm_domain', $data['new']['domain']); |
| | | $tpl->setVar('pm', $data['new']['pm']); |
| | | $tpl->setVar('pm_max_children', $data['new']['pm_max_children']); |
| | | $tpl->setVar('pm_start_servers', $data['new']['pm_start_servers']); |