File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -718,6 +718,32 @@ function get_ispconfig_port_number() {
718718 }
719719}
720720
721+ /*
722+ * Get the port number of the ISPConfig apps vhost
723+ */
724+
725+ function get_apps_vhost_port_number () {
726+ global $ conf ;
727+ if ($ conf ['nginx ' ]['installed ' ] == true ){
728+ $ ispconfig_vhost_file = $ conf ['nginx ' ]['vhost_conf_dir ' ].'/apps.vhost ' ;
729+ $ regex = '/listen (\d+)/ ' ;
730+ } else {
731+ $ ispconfig_vhost_file = $ conf ['apache ' ]['vhost_conf_dir ' ].'/apps.vhost ' ;
732+ $ regex = '/\<VirtualHost.*\:(\d{1,})\>/ ' ;
733+ }
734+
735+ if (is_file ($ ispconfig_vhost_file )) {
736+ $ tmp = file_get_contents ($ ispconfig_vhost_file );
737+ preg_match ($ regex , $ tmp , $ matches );
738+ $ port_number = @intval ($ matches [1 ]);
739+ if ($ port_number > 0 ) {
740+ return $ port_number ;
741+ } else {
742+ return '8081 ' ;
743+ }
744+ }
745+ }
746+
721747/*
722748* Get the port number of the ISPConfig controlpanel vhost
723749*/
Original file line number Diff line number Diff line change @@ -1511,6 +1511,11 @@ public function configure_apps_vhost() {
15111511 $ vhost_conf_dir = $ conf ['apache ' ]['vhost_conf_dir ' ];
15121512 $ vhost_conf_enabled_dir = $ conf ['apache ' ]['vhost_conf_enabled_dir ' ];
15131513 $ apps_vhost_servername = ($ conf ['web ' ]['apps_vhost_servername ' ] == '' )?'' :'ServerName ' .$ conf ['web ' ]['apps_vhost_servername ' ];
1514+
1515+ //* Get the apps vhost port
1516+ if ($ this ->is_update == true ) {
1517+ $ conf ['web ' ]['apps_vhost_port ' ] = get_apps_vhost_port_number ();
1518+ }
15141519
15151520 // Dont just copy over the virtualhost template but add some custom settings
15161521 $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/apache_apps.vhost.master ' , 'tpl/apache_apps.vhost.master ' );
You can’t perform that action at this time.
0 commit comments