@@ -2718,7 +2718,7 @@ private function curl_request($url, $use_ipv6 = false) {
27182718 return $ response ;
27192719 }
27202720
2721- private function make_acme_vhost ($ server_name , $ server = 'apache ' ) {
2721+ private function make_acme_vhost ($ server_name , $ server = 'apache ' , $ restart = true ) {
27222722 global $ conf ;
27232723
27242724 $ use_template = 'apache_acme.conf.master ' ;
@@ -2756,12 +2756,13 @@ private function make_acme_vhost($server_name, $server = 'apache') {
27562756 if (!@is_link ($ vhost_conf_enabled_dir .'' . $ use_symlink )) {
27572757 symlink ($ vhost_conf_dir .'/ ' . $ use_name , $ vhost_conf_enabled_dir .'/ ' . $ use_symlink );
27582758 }
2759-
2760- if ($ conf [$ server ]['installed ' ] == true && $ conf [$ server ]['init_script ' ] != '' ) {
2761- if ($ this ->is_update ) {
2762- system ($ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'force-reload ' ).' &> /dev/null || ' . $ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'restart ' ).' &> /dev/null ' );
2763- } else {
2764- system ($ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'restart ' ).' &> /dev/null ' );
2759+ if ($ restart === true ) {
2760+ if ($ conf [$ server ]['installed ' ] == true && $ conf [$ server ]['init_script ' ] != '' ) {
2761+ if ($ this ->is_update ) {
2762+ system ($ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'force-reload ' ).' &> /dev/null || ' . $ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'restart ' ).' &> /dev/null ' );
2763+ } else {
2764+ system ($ this ->getinitcommand ($ conf [$ server ]['init_script ' ], 'restart ' ).' &> /dev/null ' );
2765+ }
27652766 }
27662767 }
27672768 }
@@ -2994,9 +2995,14 @@ public function make_ispconfig_ssl_cert() {
29942995 symlink ($ vhost_conf_dir .'/ispconfig.conf ' , $ vhost_conf_enabled_dir .'/000-ispconfig.conf ' );
29952996 }
29962997 }
2997- } elseif (($ svr_ip4 && in_array ($ svr_ip4 , $ dns_ips )) || ($ svr_ip6 && in_array ($ svr_ip6 , $ dns_ips ))) {
2998- // the directory already exists so we have to assume that it was created previously
2999- $ issued_successfully = true ;
2998+ } else {
2999+ if ($ conf ['apache ' ]['installed ' ] == true ) {
3000+ $ this ->make_acme_vhost ($ hostname , 'apache ' , false ); // we need this config file but we don't want apache to be restarted at this point
3001+ }
3002+ if (($ svr_ip4 && in_array ($ svr_ip4 , $ dns_ips )) || ($ svr_ip6 && in_array ($ svr_ip6 , $ dns_ips ))) {
3003+ // the directory already exists so we have to assume that it was created previously
3004+ $ issued_successfully = true ;
3005+ }
30003006 }
30013007
30023008 // If the LE SSL certs for this hostname exists
0 commit comments