@@ -2553,7 +2553,7 @@ public function configure_apps_vhost() {
25532553 $ tpl ->setVar ('apps_vhost_dir ' ,$ conf ['web ' ]['website_basedir ' ].'/apps ' );
25542554 $ tpl ->setVar ('apps_vhost_basedir ' ,$ conf ['web ' ]['website_basedir ' ]);
25552555 $ tpl ->setVar ('apps_vhost_servername ' ,$ apps_vhost_servername );
2556- if (is_file ($ install_dir .'/interface/ssl/ispserver.crt ' ) && is_file ($ install_dir .'/interface/ssl/ispserver.key ' )) {
2556+ if (is_file ($ conf [ ' ispconfig_install_dir ' ] .'/interface/ssl/ispserver.crt ' ) && is_file ($ conf [ ' ispconfig_install_dir ' ] .'/interface/ssl/ispserver.key ' )) {
25572557 $ tpl ->setVar ('ssl_comment ' ,'' );
25582558 } else {
25592559 $ tpl ->setVar ('ssl_comment ' ,'# ' );
@@ -2636,6 +2636,15 @@ public function configure_apps_vhost() {
26362636 // Dont just copy over the virtualhost template but add some custom settings
26372637 $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/nginx_apps.vhost.master ' , 'tpl/nginx_apps.vhost.master ' );
26382638
2639+ // Enable SSL if a cert is in place.
2640+ if (is_file ($ conf ['ispconfig_install_dir ' ].'/interface/ssl/ispserver.crt ' ) && is_file ($ conf ['ispconfig_install_dir ' ].'/interface/ssl/ispserver.key ' )) {
2641+ $ content = str_replace ('{ssl_on} ' , 'ssl ' , $ content );
2642+ $ content = str_replace ('{ssl_comment} ' , '' , $ content );
2643+ } else {
2644+ $ content = str_replace ('{ssl_on} ' , '' , $ content );
2645+ $ content = str_replace ('{ssl_comment} ' , '# ' , $ content );
2646+ }
2647+
26392648 if ($ conf ['web ' ]['apps_vhost_ip ' ] == '_default_ ' ){
26402649 $ apps_vhost_ip = '' ;
26412650 } else {
@@ -2678,10 +2687,6 @@ public function configure_apps_vhost() {
26782687 $ content = str_replace ('{use_tcp} ' , $ use_tcp , $ content );
26792688 $ content = str_replace ('{use_socket} ' , $ use_socket , $ content );
26802689
2681- // SSL in apps vhost is off by default. Might change later.
2682- $ content = str_replace ('{ssl_on} ' , '' , $ content );
2683- $ content = str_replace ('{ssl_comment} ' , '# ' , $ content );
2684-
26852690 // Fix socket path on PHP 7 systems
26862691 if (file_exists ('/var/run/php/php7.0-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.0-fpm.sock ' , $ content );
26872692 if (file_exists ('/var/run/php/php7.1-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.1-fpm.sock ' , $ content );
0 commit comments