From f19eb67c3e74798677fc1ccd36b3db564c09d198 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Tue, 27 Sep 2011 13:02:52 -0400
Subject: [PATCH] - nginx: moved phpMyAdmin and SquirrelMail aliases from ISPConfig vhost to apps vhost.
---
install/lib/installer_base.lib.php | 2
install/dist/lib/fedora.lib.php | 4
install/tpl/apps_php_fpm_pool.conf.master | 18 ++++++
install/dist/lib/gentoo.lib.php | 2
install/tpl/nginx_apps.vhost.master | 38 ++++++++++++
install/tpl/nginx_ispconfig.vhost.master | 78 +++++++++++++-------------
server/conf/nginx_apps.vhost.master | 38 ++++++++++++
7 files changed, 137 insertions(+), 43 deletions(-)
diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php
index 4389534..dc9ce43 100644
--- a/install/dist/lib/fedora.lib.php
+++ b/install/dist/lib/fedora.lib.php
@@ -861,8 +861,8 @@
if($conf['nginx']['installed'] == true){
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
- // Allow the ISPConfig vhost access to /etc/squirrelmail
- $command = 'usermod -a -G '.$conf['apache']['group'].' ispconfig';
+ // Allow the ispapps vhost access to /etc/squirrelmail
+ $command = 'usermod -a -G '.$conf['apache']['group'].' ispapps';
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
}
diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php
index 03165e6..f7a0df1 100644
--- a/install/dist/lib/gentoo.lib.php
+++ b/install/dist/lib/gentoo.lib.php
@@ -653,7 +653,7 @@
// PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
- $content = rf('tpl/php_fpm_pool.conf.master');
+ $content = rf('tpl/apps_php_fpm_pool.conf.master');
$content = str_replace('{fpm_pool}', 'apps', $content);
$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
$content = str_replace('{fpm_user}', $apps_vhost_user, $content);
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 197aee3..f145e24 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1483,7 +1483,7 @@
// PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
- $content = rf('tpl/php_fpm_pool.conf.master');
+ $content = rf('tpl/apps_php_fpm_pool.conf.master');
$content = str_replace('{fpm_pool}', 'apps', $content);
$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
$content = str_replace('{fpm_user}', $apps_vhost_user, $content);
diff --git a/install/tpl/apps_php_fpm_pool.conf.master b/install/tpl/apps_php_fpm_pool.conf.master
new file mode 100644
index 0000000..b5000e7
--- /dev/null
+++ b/install/tpl/apps_php_fpm_pool.conf.master
@@ -0,0 +1,18 @@
+[{fpm_pool}]
+
+listen = 127.0.0.1:{fpm_port}
+
+listen.allowed_clients = 127.0.0.1
+
+user = {fpm_user}
+group = {fpm_group}
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 20
+pm.min_spare_servers = 5
+pm.max_spare_servers = 35
+
+chdir = /
+
+php_admin_flag[magic_quotes_gpc] = off
\ No newline at end of file
diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master
index b0bd3a3..0ba7fc2 100644
--- a/install/tpl/nginx_apps.vhost.master
+++ b/install/tpl/nginx_apps.vhost.master
@@ -30,4 +30,42 @@
location ~ /\. {
deny all;
}
+
+ location /phpmyadmin {
+ root /usr/share/;
+ index index.php index.html index.htm;
+ location ~ ^/phpmyadmin/(.+\.php)$ {
+ try_files $uri =404;
+ root /usr/share/;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass 127.0.0.1:{fpm_port};
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+ location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+ root /usr/share/;
+ }
+ }
+ location /phpMyAdmin {
+ rewrite ^/* /phpmyadmin last;
+ }
+
+ location /squirrelmail {
+ root /usr/share/;
+ index index.php index.html index.htm;
+ location ~ ^/squirrelmail/(.+\.php)$ {
+ try_files $uri =404;
+ root /usr/share/;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass 127.0.0.1:{fpm_port};
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+ location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+ root /usr/share/;
+ }
+ }
+ location /webmail {
+ rewrite ^/* /squirrelmail last;
+ }
}
\ No newline at end of file
diff --git a/install/tpl/nginx_ispconfig.vhost.master b/install/tpl/nginx_ispconfig.vhost.master
index ffaf760..967fba9 100644
--- a/install/tpl/nginx_ispconfig.vhost.master
+++ b/install/tpl/nginx_ispconfig.vhost.master
@@ -33,43 +33,43 @@
deny all;
}
- location /phpmyadmin {
- root /usr/share/;
- index index.php index.html index.htm;
- location ~ ^/phpmyadmin/(.+\.php)$ {
- try_files $uri =404;
- root /usr/share/;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:{fpm_port};
- {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl};
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- }
- location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
- root /usr/share/;
- }
- }
- location /phpMyAdmin {
- rewrite ^/* /phpmyadmin last;
- }
-
- location /squirrelmail {
- root /usr/share/;
- index index.php index.html index.htm;
- location ~ ^/squirrelmail/(.+\.php)$ {
- try_files $uri =404;
- root /usr/share/;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:{fpm_port};
- {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl};
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- }
- location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
- root /usr/share/;
- }
- }
- location /webmail {
- rewrite ^/* /squirrelmail last;
- }
+# location /phpmyadmin {
+# root /usr/share/;
+# index index.php index.html index.htm;
+# location ~ ^/phpmyadmin/(.+\.php)$ {
+# try_files $uri =404;
+# root /usr/share/;
+# include /etc/nginx/fastcgi_params;
+# fastcgi_pass 127.0.0.1:{fpm_port};
+# {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl};
+# fastcgi_index index.php;
+# fastcgi_param SCRIPT_FILENAME $request_filename;
+# }
+# location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+# root /usr/share/;
+# }
+# }
+# location /phpMyAdmin {
+# rewrite ^/* /phpmyadmin last;
+# }
+#
+# location /squirrelmail {
+# root /usr/share/;
+# index index.php index.html index.htm;
+# location ~ ^/squirrelmail/(.+\.php)$ {
+# try_files $uri =404;
+# root /usr/share/;
+# include /etc/nginx/fastcgi_params;
+# fastcgi_pass 127.0.0.1:{fpm_port};
+# {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl};
+# fastcgi_index index.php;
+# fastcgi_param SCRIPT_FILENAME $request_filename;
+# }
+# location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+# root /usr/share/;
+# }
+# }
+# location /webmail {
+# rewrite ^/* /squirrelmail last;
+# }
}
\ No newline at end of file
diff --git a/server/conf/nginx_apps.vhost.master b/server/conf/nginx_apps.vhost.master
index b0bd3a3..0ba7fc2 100644
--- a/server/conf/nginx_apps.vhost.master
+++ b/server/conf/nginx_apps.vhost.master
@@ -30,4 +30,42 @@
location ~ /\. {
deny all;
}
+
+ location /phpmyadmin {
+ root /usr/share/;
+ index index.php index.html index.htm;
+ location ~ ^/phpmyadmin/(.+\.php)$ {
+ try_files $uri =404;
+ root /usr/share/;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass 127.0.0.1:{fpm_port};
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+ location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+ root /usr/share/;
+ }
+ }
+ location /phpMyAdmin {
+ rewrite ^/* /phpmyadmin last;
+ }
+
+ location /squirrelmail {
+ root /usr/share/;
+ index index.php index.html index.htm;
+ location ~ ^/squirrelmail/(.+\.php)$ {
+ try_files $uri =404;
+ root /usr/share/;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass 127.0.0.1:{fpm_port};
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+ location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
+ root /usr/share/;
+ }
+ }
+ location /webmail {
+ rewrite ^/* /squirrelmail last;
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1