From bdaa3da31091d530b3f1516bc3924a52e075b660 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:51:13 +0100 Subject: [PATCH] php8.0 apache templates --- .../tools/apache-fpm-tpl/PHP-FPM-74-public.sh | 2 +- .../tools/apache-fpm-tpl/PHP-FPM-74.sh | 2 +- .../tools/apache-fpm-tpl/PHP-FPM-80-public.sh | 98 +++++++++++++++++++ .../apache-fpm-tpl/PHP-FPM-80-public.stpl | 44 +++++++++ .../apache-fpm-tpl/PHP-FPM-80-public.tpl | 38 +++++++ .../tools/apache-fpm-tpl/PHP-FPM-80.sh | 98 +++++++++++++++++++ .../tools/apache-fpm-tpl/PHP-FPM-80.stpl | 44 +++++++++ .../tools/apache-fpm-tpl/PHP-FPM-80.tpl | 38 +++++++ 8 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl create mode 100644 src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh index 64cbaaf6..6f6290b1 100755 --- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh @@ -69,7 +69,7 @@ fi if [ -f "$pool_file_73" ]; then rm $pool_file_73 - service php7-3-fpm restart + service php7.3-fpm restart fi write_file=0 diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh index 552cd112..482cdd7e 100755 --- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh @@ -69,7 +69,7 @@ fi if [ -f "$pool_file_73" ]; then rm $pool_file_73 - service php7-3-fpm restart + service php7.3-fpm restart fi write_file=0 diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh new file mode 100644 index 00000000..5f119dd8 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# Adding php pool conf +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +pool_conf="[$2] + +listen = /run/php/php8.0-fpm-$2.sock +listen.owner = $1 +listen.group = $1 +listen.mode = 0666 + +user = $1 +group = $1 + +pm = ondemand +pm.max_children = 16 +request_terminate_timeout = 30s +pm.max_requests = 4000 +pm.process_idle_timeout = 10s +pm.status_path = /status + +php_admin_value[upload_tmp_dir] = /home/$1/tmp +php_admin_value[session.save_path] = /home/$1/tmp +php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube +php_admin_value[upload_max_filesize] = 80M +php_admin_value[max_execution_time] = 20 +php_admin_value[post_max_size] = 80M +php_admin_value[memory_limit] = 256M +php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\" +php_admin_flag[mysql.allow_persistent] = off +php_admin_flag[safe_mode] = off + +env[PATH] = /usr/local/bin:/usr/bin:/bin +env[TMP] = /home/$1/tmp +env[TMPDIR] = /home/$1/tmp +env[TEMP] = /home/$1/tmp +" + +pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf" +pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf" +pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf" +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" + +if [ -f "$pool_file_56" ]; then + rm $pool_file_56 + service php5.6-fpm restart +fi + +if [ -f "$pool_file_70" ]; then + rm $pool_file_70 + service php7.0-fpm restart +fi + +if [ -f "$pool_file_71" ]; then + rm $pool_file_71 + service php7.1-fpm restart +fi + +if [ -f "$pool_file_72" ]; then + rm $pool_file_72 + service php7.2-fpm restart +fi + +if [ -f "$pool_file_73" ]; then + rm $pool_file_73 + service php7.3-fpm restart +fi + +if [ -f "$pool_file_74" ]; then + rm $pool_file_74 + service php7.4-fpm restart +fi + +write_file=0 +if [ ! -f "$pool_file_80" ]; then + write_file=1 +else + user_count=$(grep -c "/home/$1/" $pool_file_80) + if [ $user_count -eq 0 ]; then + write_file=1 + fi +fi +if [ $write_file -eq 1 ]; then + echo "$pool_conf" > $pool_file_80 + service php8.0-fpm restart +fi +if [ -f "/etc/php/8.0/fpm/pool.d/www.conf" ]; then + rm /etc/php/8.0/fpm/pool.d/www.conf +fi + +exit 0 \ No newline at end of file diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl new file mode 100644 index 00000000..4ce4b993 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl @@ -0,0 +1,44 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot%/public + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + + + AllowOverride All + SSLRequireSSL + Options +Includes -Indexes +ExecCGI + + 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/php8.0-fpm-%domain%.sock|fcgi://localhost/" + + SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 + + IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl new file mode 100644 index 00000000..41a5d506 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl @@ -0,0 +1,38 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot%/public + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + + + AllowOverride All + Options +Includes -Indexes +ExecCGI + +# +# RMode config +# RUidGid %user% %group% +# RGroups www-data +# +# +# AssignUserID %user% %group% +# + + + SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/" + + SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 + + IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh new file mode 100644 index 00000000..5f119dd8 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# Adding php pool conf +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +pool_conf="[$2] + +listen = /run/php/php8.0-fpm-$2.sock +listen.owner = $1 +listen.group = $1 +listen.mode = 0666 + +user = $1 +group = $1 + +pm = ondemand +pm.max_children = 16 +request_terminate_timeout = 30s +pm.max_requests = 4000 +pm.process_idle_timeout = 10s +pm.status_path = /status + +php_admin_value[upload_tmp_dir] = /home/$1/tmp +php_admin_value[session.save_path] = /home/$1/tmp +php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube +php_admin_value[upload_max_filesize] = 80M +php_admin_value[max_execution_time] = 20 +php_admin_value[post_max_size] = 80M +php_admin_value[memory_limit] = 256M +php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\" +php_admin_flag[mysql.allow_persistent] = off +php_admin_flag[safe_mode] = off + +env[PATH] = /usr/local/bin:/usr/bin:/bin +env[TMP] = /home/$1/tmp +env[TMPDIR] = /home/$1/tmp +env[TEMP] = /home/$1/tmp +" + +pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf" +pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf" +pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf" +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" + +if [ -f "$pool_file_56" ]; then + rm $pool_file_56 + service php5.6-fpm restart +fi + +if [ -f "$pool_file_70" ]; then + rm $pool_file_70 + service php7.0-fpm restart +fi + +if [ -f "$pool_file_71" ]; then + rm $pool_file_71 + service php7.1-fpm restart +fi + +if [ -f "$pool_file_72" ]; then + rm $pool_file_72 + service php7.2-fpm restart +fi + +if [ -f "$pool_file_73" ]; then + rm $pool_file_73 + service php7.3-fpm restart +fi + +if [ -f "$pool_file_74" ]; then + rm $pool_file_74 + service php7.4-fpm restart +fi + +write_file=0 +if [ ! -f "$pool_file_80" ]; then + write_file=1 +else + user_count=$(grep -c "/home/$1/" $pool_file_80) + if [ $user_count -eq 0 ]; then + write_file=1 + fi +fi +if [ $write_file -eq 1 ]; then + echo "$pool_conf" > $pool_file_80 + service php8.0-fpm restart +fi +if [ -f "/etc/php/8.0/fpm/pool.d/www.conf" ]; then + rm /etc/php/8.0/fpm/pool.d/www.conf +fi + +exit 0 \ No newline at end of file diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl new file mode 100644 index 00000000..f39e9631 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl @@ -0,0 +1,44 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + + + AllowOverride All + SSLRequireSSL + Options +Includes -Indexes +ExecCGI + + 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/php8.0-fpm-%domain%.sock|fcgi://localhost/" + + SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 + + IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl new file mode 100644 index 00000000..b9e32f14 --- /dev/null +++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl @@ -0,0 +1,38 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + + + AllowOverride All + Options +Includes -Indexes +ExecCGI + +# +# RMode config +# RUidGid %user% %group% +# RGroups www-data +# +# +# AssignUserID %user% %group% +# + + + SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/" + + SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 + + IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf* + + +