@@ -1472,20 +1472,27 @@ public function configure_apps_vhost() {
14721472 } else {
14731473 $ apps_vhost_ip = $ conf ['web ' ]['apps_vhost_ip ' ].': ' ;
14741474 }
1475+
1476+ $ socket_dir = escapeshellcmd ($ conf ['nginx ' ]['php_fpm_socket_dir ' ]);
1477+ if (substr ($ socket_dir ,-1 ) != '/ ' ) $ socket_dir .= '/ ' ;
1478+ if (!is_dir ($ socket_dir )) exec ('mkdir -p ' .$ socket_dir );
1479+ $ fpm_socket = $ socket_dir .'apps.sock ' ;
14751480
14761481 $ content = str_replace ('{apps_vhost_ip} ' , $ apps_vhost_ip , $ content );
14771482 $ content = str_replace ('{apps_vhost_port} ' , $ conf ['web ' ]['apps_vhost_port ' ], $ content );
14781483 $ content = str_replace ('{apps_vhost_dir} ' , $ conf ['web ' ]['website_basedir ' ].'/apps ' , $ content );
14791484 $ content = str_replace ('{apps_vhost_servername} ' , $ apps_vhost_servername , $ content );
1480- $ content = str_replace ('{fpm_port} ' , ($ conf ['nginx ' ]['php_fpm_start_port ' ]+1 ), $ content );
1485+ //$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
1486+ $ content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ content );
14811487
14821488 wf ($ vhost_conf_dir .'/apps.vhost ' , $ content );
14831489
14841490 // PHP-FPM
14851491 // Dont just copy over the php-fpm pool template but add some custom settings
14861492 $ content = rf ('tpl/apps_php_fpm_pool.conf.master ' );
14871493 $ content = str_replace ('{fpm_pool} ' , 'apps ' , $ content );
1488- $ content = str_replace ('{fpm_port} ' , ($ conf ['nginx ' ]['php_fpm_start_port ' ]+1 ), $ content );
1494+ //$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
1495+ $ content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ content );
14891496 $ content = str_replace ('{fpm_user} ' , $ apps_vhost_user , $ content );
14901497 $ content = str_replace ('{fpm_group} ' , $ apps_vhost_group , $ content );
14911498 wf ($ conf ['nginx ' ]['php_fpm_pool_dir ' ].'/apps.conf ' , $ content );
@@ -1808,8 +1815,14 @@ public function install_ispconfig() {
18081815 $ content = str_replace ('{fastcgi_ssl} ' , 'off ' , $ content );
18091816 }
18101817
1811- $ content = str_replace ('{fpm_port} ' , $ conf ['nginx ' ]['php_fpm_start_port ' ], $ content );
1812-
1818+ $ socket_dir = escapeshellcmd ($ conf ['nginx ' ]['php_fpm_socket_dir ' ]);
1819+ if (substr ($ socket_dir ,-1 ) != '/ ' ) $ socket_dir .= '/ ' ;
1820+ if (!is_dir ($ socket_dir )) exec ('mkdir -p ' .$ socket_dir );
1821+ $ fpm_socket = $ socket_dir .'ispconfig.sock ' ;
1822+
1823+ //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
1824+ $ content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ content );
1825+
18131826 wf ($ vhost_conf_dir .'/ispconfig.vhost ' , $ content );
18141827
18151828 unset($ content );
@@ -1818,7 +1831,8 @@ public function install_ispconfig() {
18181831 // Dont just copy over the php-fpm pool template but add some custom settings
18191832 $ content = rf ('tpl/php_fpm_pool.conf.master ' );
18201833 $ content = str_replace ('{fpm_pool} ' , 'ispconfig ' , $ content );
1821- $ content = str_replace ('{fpm_port} ' , $ conf ['nginx ' ]['php_fpm_start_port ' ], $ content );
1834+ //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
1835+ $ content = str_replace ('{fpm_socket} ' , $ fpm_socket , $ content );
18221836 $ content = str_replace ('{fpm_user} ' , 'ispconfig ' , $ content );
18231837 $ content = str_replace ('{fpm_group} ' , 'ispconfig ' , $ content );
18241838 wf ($ conf ['nginx ' ]['php_fpm_pool_dir ' ].'/ispconfig.conf ' , $ content );
0 commit comments