diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 91b36965983010f62c730e22247340f63283836c..0e0dbe84461e0db9186fff8c4afcf59bfd0bbd11 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -2718,7 +2718,7 @@ class installer_base { return $response; } - private function make_acme_vhost($server_name, $server = 'apache') { + private function make_acme_vhost($server_name, $server = 'apache', $restart = true) { global $conf; $use_template = 'apache_acme.conf.master'; @@ -2756,12 +2756,13 @@ class installer_base { if(!@is_link($vhost_conf_enabled_dir.'' . $use_symlink)) { symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enabled_dir.'/' . $use_symlink); } - - if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') { - if($this->is_update) { - system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); - } else { - system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + if($restart === true) { + if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') { + if($this->is_update) { + system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + } else { + system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + } } } } @@ -2994,9 +2995,14 @@ class installer_base { symlink($vhost_conf_dir.'/ispconfig.conf', $vhost_conf_enabled_dir.'/000-ispconfig.conf'); } } - } elseif(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))) { - // the directory already exists so we have to assume that it was created previously - $issued_successfully = true; + } else { + if($conf['apache']['installed'] == true) { + $this->make_acme_vhost($hostname, 'apache', false); // we need this config file but we don't want apache to be restarted at this point + } + if(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))) { + // the directory already exists so we have to assume that it was created previously + $issued_successfully = true; + } } // If the LE SSL certs for this hostname exists diff --git a/install/tpl/apache_acme.conf.master b/install/tpl/apache_acme.conf.master index 4a1629433525ca40208b9e9e4db66f8f4d5730d2..38a68d29ead9db31af97623650f51f64bd59952f 100644 --- a/install/tpl/apache_acme.conf.master +++ b/install/tpl/apache_acme.conf.master @@ -1,11 +1,13 @@ - Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge - - <Directory /usr/local/ispconfig/interface/acme> - AllowOverride None +Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge +<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> <tmpl_if name='apache_version' op='>' value='2.2' format='version'> Require all granted <tmpl_else> - Order allow,deny - Allow from all + Order allow,deny + Allow from all </tmpl_if> - </Directory> + <IfModule mpm_itk_module> + AssignUserId ispconfig ispconfig + </IfModule> +</Directory> + diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master index a376f68d8270f9b1c6bf6076c0471fd5ef7d0a8d..7d57e00517066e7935895c7cdb127df5b78ec77e 100644 --- a/install/tpl/apache_ispconfig.conf.master +++ b/install/tpl/apache_ispconfig.conf.master @@ -132,19 +132,6 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge -<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> - <tmpl_if name='apache_version' op='>' value='2.2' format='version'> - Require all granted - <tmpl_else> - Order allow,deny - Allow from all - </tmpl_if> - <IfModule mpm_itk_module> - AssignUserId ispconfig ispconfig - </IfModule> -</Directory> - NameVirtualHost *:80 NameVirtualHost *:443 <tmpl_loop name="ip_adresses"> diff --git a/server/conf/apache_ispconfig.conf.master b/server/conf/apache_ispconfig.conf.master index e7058cd439a7672c47596c1d4e11571bbe11886e..831a18a0e1f4ed61ff316ceb7f0fcab89de8bcbc 100644 --- a/server/conf/apache_ispconfig.conf.master +++ b/server/conf/apache_ispconfig.conf.master @@ -127,19 +127,6 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge -<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> - <tmpl_if name='apache_version' op='>' value='2.2' format='version'> - Require all granted - <tmpl_else> - Order allow,deny - Allow from all - </tmpl_if> - <IfModule mpm_itk_module> - AssignUserId ispconfig ispconfig - </IfModule> -</Directory> - NameVirtualHost *:80 NameVirtualHost *:443 <tmpl_loop name="ip_adresses">