From af61d62c47bd0ec57e5659f806d7fbff58a0c390 Mon Sep 17 00:00:00 2001
From: myvesta <38690722+myvesta@users.noreply.github.com>
Date: Sat, 17 Jun 2023 14:46:05 +0200
Subject: [PATCH] debian12 php8.2 templates
---
...-FPM-74-public.sh => PHP-FPM-82-public.sh} | 44 ++++++++++++-------
...-74-public.stpl => PHP-FPM-82-public.stpl} | 12 +----
...PM-74-public.tpl => PHP-FPM-82-public.tpl} | 12 +----
.../apache2/{PHP-FPM-74.sh => PHP-FPM-82.sh} | 44 ++++++++++++-------
.../{PHP-FPM-74.stpl => PHP-FPM-82.stpl} | 12 +----
.../{PHP-FPM-74.tpl => PHP-FPM-82.tpl} | 12 +----
6 files changed, 66 insertions(+), 70 deletions(-)
rename install/debian/12/templates/web/apache2/{PHP-FPM-74-public.sh => PHP-FPM-82-public.sh} (79%)
mode change 100755 => 100644
rename install/debian/12/templates/web/apache2/{PHP-FPM-74-public.stpl => PHP-FPM-82-public.stpl} (77%)
rename install/debian/12/templates/web/apache2/{PHP-FPM-74-public.tpl => PHP-FPM-82-public.tpl} (74%)
rename install/debian/12/templates/web/apache2/{PHP-FPM-74.sh => PHP-FPM-82.sh} (79%)
mode change 100755 => 100644
rename install/debian/12/templates/web/apache2/{PHP-FPM-74.stpl => PHP-FPM-82.stpl} (77%)
rename install/debian/12/templates/web/apache2/{PHP-FPM-74.tpl => PHP-FPM-82.tpl} (74%)
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.sh b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.sh
old mode 100755
new mode 100644
similarity index 79%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74-public.sh
rename to install/debian/12/templates/web/apache2/PHP-FPM-82-public.sh
index e72bb0032..a4deb752f
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.sh
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.sh
@@ -8,7 +8,7 @@ docroot="$5"
pool_conf="[$2]
-listen = /run/php/php7.4-fpm-$2.sock
+listen = /run/php/php8.2-fpm-$2.sock
listen.owner = $1
listen.group = $1
listen.mode = 0666
@@ -47,6 +47,8 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
@@ -78,23 +80,11 @@ if [ -f "$pool_file_73" ]; then
systemctl restart php7.3-fpm
fi
-write_file=0
-if [ ! -f "$pool_file_74" ]; then
- write_file=1
-else
- user_count=$(grep -c "/home/$1/" $pool_file_74)
- if [ $user_count -eq 0 ]; then
- write_file=1
- fi
-fi
-if [ $write_file -eq 1 ]; then
- echo "$pool_conf" > $pool_file_74
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
systemctl reset-failed php7.4-fpm
systemctl restart php7.4-fpm
fi
-if [ -f "/etc/php/7.4/fpm/pool.d/www.conf" ]; then
- rm /etc/php/7.4/fpm/pool.d/www.conf
-fi
if [ -f "$pool_file_80" ]; then
rm $pool_file_80
@@ -102,4 +92,28 @@ if [ -f "$pool_file_80" ]; then
systemctl restart php8.0-fpm
fi
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_82" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_82)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+if [ -f "/etc/php/8.2/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.2/fpm/pool.d/www.conf
+fi
+
exit 0
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.stpl b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.stpl
similarity index 77%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74-public.stpl
rename to install/debian/12/templates/web/apache2/PHP-FPM-82-public.stpl
index fdbc26f95..809e7f336 100644
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.stpl
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.stpl
@@ -17,24 +17,16 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
-#
-# RMode config
-# RUidGid %user% %group%
-# RGroups www-data
-#
-#
-# AssignUserID %user% %group%
-#
- SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/"
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.tpl b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.tpl
similarity index 74%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74-public.tpl
rename to install/debian/12/templates/web/apache2/PHP-FPM-82-public.tpl
index 614f20c3d..679d14095 100644
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74-public.tpl
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82-public.tpl
@@ -16,19 +16,11 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
-#
-# RMode config
-# RUidGid %user% %group%
-# RGroups www-data
-#
-#
-# AssignUserID %user% %group%
-#
- SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/"
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74.sh b/install/debian/12/templates/web/apache2/PHP-FPM-82.sh
old mode 100755
new mode 100644
similarity index 79%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74.sh
rename to install/debian/12/templates/web/apache2/PHP-FPM-82.sh
index e72bb0032..a4deb752f
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74.sh
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82.sh
@@ -8,7 +8,7 @@ docroot="$5"
pool_conf="[$2]
-listen = /run/php/php7.4-fpm-$2.sock
+listen = /run/php/php8.2-fpm-$2.sock
listen.owner = $1
listen.group = $1
listen.mode = 0666
@@ -47,6 +47,8 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
@@ -78,23 +80,11 @@ if [ -f "$pool_file_73" ]; then
systemctl restart php7.3-fpm
fi
-write_file=0
-if [ ! -f "$pool_file_74" ]; then
- write_file=1
-else
- user_count=$(grep -c "/home/$1/" $pool_file_74)
- if [ $user_count -eq 0 ]; then
- write_file=1
- fi
-fi
-if [ $write_file -eq 1 ]; then
- echo "$pool_conf" > $pool_file_74
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
systemctl reset-failed php7.4-fpm
systemctl restart php7.4-fpm
fi
-if [ -f "/etc/php/7.4/fpm/pool.d/www.conf" ]; then
- rm /etc/php/7.4/fpm/pool.d/www.conf
-fi
if [ -f "$pool_file_80" ]; then
rm $pool_file_80
@@ -102,4 +92,28 @@ if [ -f "$pool_file_80" ]; then
systemctl restart php8.0-fpm
fi
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_82" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_82)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+if [ -f "/etc/php/8.2/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.2/fpm/pool.d/www.conf
+fi
+
exit 0
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74.stpl b/install/debian/12/templates/web/apache2/PHP-FPM-82.stpl
similarity index 77%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74.stpl
rename to install/debian/12/templates/web/apache2/PHP-FPM-82.stpl
index df6072473..e0d047948 100644
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74.stpl
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82.stpl
@@ -17,24 +17,16 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
-#
-# RMode config
-# RUidGid %user% %group%
-# RGroups www-data
-#
-#
-# AssignUserID %user% %group%
-#
- SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/"
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
diff --git a/install/debian/12/templates/web/apache2/PHP-FPM-74.tpl b/install/debian/12/templates/web/apache2/PHP-FPM-82.tpl
similarity index 74%
rename from install/debian/12/templates/web/apache2/PHP-FPM-74.tpl
rename to install/debian/12/templates/web/apache2/PHP-FPM-82.tpl
index 7b6e2cb56..eba95935e 100644
--- a/install/debian/12/templates/web/apache2/PHP-FPM-74.tpl
+++ b/install/debian/12/templates/web/apache2/PHP-FPM-82.tpl
@@ -16,19 +16,11 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
-#
-# RMode config
-# RUidGid %user% %group%
-# RGroups www-data
-#
-#
-# AssignUserID %user% %group%
-#
- SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/"
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0