debian12 php8.2 templates

This commit is contained in:
myvesta 2023-06-17 14:46:05 +02:00 committed by GitHub
parent b5ccfbed82
commit af61d62c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 70 deletions

View file

@ -8,7 +8,7 @@ docroot="$5"
pool_conf="[$2] pool_conf="[$2]
listen = /run/php/php7.4-fpm-$2.sock listen = /run/php/php8.2-fpm-$2.sock
listen.owner = $1 listen.owner = $1
listen.group = $1 listen.group = $1
listen.mode = 0666 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_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/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_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 if [ -f "$pool_file_56" ]; then
rm $pool_file_56 rm $pool_file_56
@ -78,23 +80,11 @@ if [ -f "$pool_file_73" ]; then
systemctl restart php7.3-fpm systemctl restart php7.3-fpm
fi fi
write_file=0 if [ -f "$pool_file_74" ]; then
if [ ! -f "$pool_file_74" ]; then rm $pool_file_74
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
systemctl reset-failed php7.4-fpm systemctl reset-failed php7.4-fpm
systemctl restart php7.4-fpm systemctl restart php7.4-fpm
fi 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 if [ -f "$pool_file_80" ]; then
rm $pool_file_80 rm $pool_file_80
@ -102,4 +92,28 @@ if [ -f "$pool_file_80" ]; then
systemctl restart php8.0-fpm systemctl restart php8.0-fpm
fi 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 exit 0

View file

@ -17,24 +17,16 @@
<Directory %sdocroot%> <Directory %sdocroot%>
AllowOverride All AllowOverride All
SSLRequireSSL SSLRequireSSL
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
</Directory> </Directory>
SSLEngine on SSLEngine on
SSLVerifyClient none SSLVerifyClient none
SSLCertificateFile %ssl_crt% SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key% SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca% %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
# <IfModule mod_ruid2.c>
# RMode config
# RUidGid %user% %group%
# RGroups www-data
# </IfModule>
# <IfModule itk.c>
# AssignUserID %user% %group%
# </IfModule>
<FilesMatch \.php$> <FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/" SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
</FilesMatch> </FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

View file

@ -16,19 +16,11 @@
</Directory> </Directory>
<Directory %sdocroot%> <Directory %sdocroot%>
AllowOverride All AllowOverride All
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
</Directory> </Directory>
# <IfModule mod_ruid2.c>
# RMode config
# RUidGid %user% %group%
# RGroups www-data
# </IfModule>
# <IfModule itk.c>
# AssignUserID %user% %group%
# </IfModule>
<FilesMatch \.php$> <FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/" SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
</FilesMatch> </FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

View file

@ -8,7 +8,7 @@ docroot="$5"
pool_conf="[$2] pool_conf="[$2]
listen = /run/php/php7.4-fpm-$2.sock listen = /run/php/php8.2-fpm-$2.sock
listen.owner = $1 listen.owner = $1
listen.group = $1 listen.group = $1
listen.mode = 0666 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_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/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_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 if [ -f "$pool_file_56" ]; then
rm $pool_file_56 rm $pool_file_56
@ -78,23 +80,11 @@ if [ -f "$pool_file_73" ]; then
systemctl restart php7.3-fpm systemctl restart php7.3-fpm
fi fi
write_file=0 if [ -f "$pool_file_74" ]; then
if [ ! -f "$pool_file_74" ]; then rm $pool_file_74
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
systemctl reset-failed php7.4-fpm systemctl reset-failed php7.4-fpm
systemctl restart php7.4-fpm systemctl restart php7.4-fpm
fi 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 if [ -f "$pool_file_80" ]; then
rm $pool_file_80 rm $pool_file_80
@ -102,4 +92,28 @@ if [ -f "$pool_file_80" ]; then
systemctl restart php8.0-fpm systemctl restart php8.0-fpm
fi 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 exit 0

View file

@ -17,24 +17,16 @@
<Directory %sdocroot%> <Directory %sdocroot%>
AllowOverride All AllowOverride All
SSLRequireSSL SSLRequireSSL
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
</Directory> </Directory>
SSLEngine on SSLEngine on
SSLVerifyClient none SSLVerifyClient none
SSLCertificateFile %ssl_crt% SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key% SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca% %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
# <IfModule mod_ruid2.c>
# RMode config
# RUidGid %user% %group%
# RGroups www-data
# </IfModule>
# <IfModule itk.c>
# AssignUserID %user% %group%
# </IfModule>
<FilesMatch \.php$> <FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/" SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
</FilesMatch> </FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

View file

@ -16,19 +16,11 @@
</Directory> </Directory>
<Directory %sdocroot%> <Directory %sdocroot%>
AllowOverride All AllowOverride All
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
</Directory> </Directory>
# <IfModule mod_ruid2.c>
# RMode config
# RUidGid %user% %group%
# RGroups www-data
# </IfModule>
# <IfModule itk.c>
# AssignUserID %user% %group%
# </IfModule>
<FilesMatch \.php$> <FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm-%domain%.sock|fcgi://localhost/" SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
</FilesMatch> </FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0