@@ -99,6 +99,9 @@ function update($event_name,$data) {
9999 } else {
100100 $ content = str_replace ('{vhost_port_listen} ' , '' , $ content );
101101 }
102+
103+ file_put_contents ("$ vhost_conf_dir/apps.vhost " , $ content );
104+ $ app ->services ->restartServiceDelayed ('httpd ' ,'restart ' );
102105 }
103106
104107 if ($ web_config ['server_type ' ] == 'nginx ' ){
@@ -108,6 +111,9 @@ function update($event_name,$data) {
108111 $ vhost_conf_dir = $ web_config ['nginx_vhost_conf_dir ' ];
109112 $ vhost_conf_enabled_dir = $ web_config ['nginx_vhost_conf_enabled_dir ' ];
110113 $ apps_vhost_servername = ($ web_config ['apps_vhost_servername ' ] == '' )?'_ ' :$ web_config ['apps_vhost_servername ' ];
114+
115+ $ apps_vhost_user = 'ispapps ' ;
116+ $ apps_vhost_group = 'ispapps ' ;
111117
112118 $ web_config ['apps_vhost_port ' ] = (empty ($ web_config ['apps_vhost_port ' ]))?8081 :$ web_config ['apps_vhost_port ' ];
113119 $ web_config ['apps_vhost_ip ' ] = (empty ($ web_config ['apps_vhost_ip ' ]))?'_default_ ' :$ web_config ['apps_vhost_ip ' ];
@@ -129,10 +135,20 @@ function update($event_name,$data) {
129135 $ content = str_replace ('{apps_vhost_servername} ' , $ apps_vhost_servername , $ content );
130136 //$content = str_replace('{fpm_port}', $web_config['php_fpm_start_port']+1, $content);
131137 $ content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ content );
138+
139+ // PHP-FPM
140+ // Dont just copy over the php-fpm pool template but add some custom settings
141+ $ fpm_content = file_get_contents ($ conf ["rootpath " ]."/conf/apps_php_fpm_pool.conf.master " );
142+ $ fpm_content = str_replace ('{fpm_pool} ' , 'apps ' , $ fpm_content );
143+ //$fpm_content = str_replace('{fpm_port}', $web_config['php_fpm_start_port']+1, $fpm_content);
144+ $ fpm_content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ fpm_content );
145+ $ fpm_content = str_replace ('{fpm_user} ' , $ apps_vhost_user , $ fpm_content );
146+ $ fpm_content = str_replace ('{fpm_group} ' , $ apps_vhost_group , $ fpm_content );
147+ file_put_contents ($ web_config ['php_fpm_pool_dir ' ].'/apps.conf ' , $ fpm_content );
148+
149+ file_put_contents ("$ vhost_conf_dir/apps.vhost " , $ content );
150+ $ app ->services ->restartServiceDelayed ('httpd ' ,'reload ' );
132151 }
133-
134- file_put_contents ("$ vhost_conf_dir/apps.vhost " , $ content );
135- $ app ->services ->restartServiceDelayed ('httpd ' ,'restart ' );
136152 }
137153
138154
0 commit comments