Commit 183c476b authored by Falko Timme's avatar Falko Timme
Browse files

- Added check for the apps vhost to find out if the default PHP-FPM pool uses...

- Added check for the apps vhost to find out if the default PHP-FPM pool uses port 9000 or the socket /var/run/php5-fpm.sock.
parent 5a3b0bad
......@@ -1555,6 +1555,16 @@ class installer_base {
//$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
$content = str_replace('{cgi_socket}', $cgi_socket, $content);
if(file_exists('/var/run/php5-fpm.sock')){
$use_tcp = '#';
$use_socket = '';
} else {
$use_tcp = '';
$use_socket = '#';
}
$content = str_replace('{use_tcp}', $use_tcp, $content);
$content = str_replace('{use_socket}', $use_socket, $content);
wf($vhost_conf_dir.'/apps.vhost', $content);
......
......@@ -41,7 +41,8 @@ server {
root /usr/share/;
include /etc/nginx/fastcgi_params;
# To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
fastcgi_pass 127.0.0.1:9000;
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
......@@ -66,7 +67,8 @@ server {
root /usr/share/;
include /etc/nginx/fastcgi_params;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
fastcgi_pass 127.0.0.1:9000;
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
......
......@@ -41,7 +41,8 @@ server {
root /usr/share/;
include /etc/nginx/fastcgi_params;
# To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
fastcgi_pass 127.0.0.1:9000;
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
......@@ -66,7 +67,8 @@ server {
root /usr/share/;
include /etc/nginx/fastcgi_params;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
fastcgi_pass 127.0.0.1:9000;
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
......
......@@ -141,6 +141,15 @@ class apps_vhost_plugin {
//$content = str_replace('{fpm_port}', $web_config['php_fpm_start_port']+1, $content);
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
$content = str_replace('{cgi_socket}', $cgi_socket, $content);
if(file_exists('/var/run/php5-fpm.sock')){
$use_tcp = '#';
$use_socket = '';
} else {
$use_tcp = '';
$use_socket = '#';
}
$content = str_replace('{use_tcp}', $use_tcp, $content);
$content = str_replace('{use_socket}', $use_socket, $content);
// PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment