diff --git a/src/deb/for-download/tools/patches/fix-fpm-poold.sh b/src/deb/for-download/tools/patches/fix-fpm-poold.sh new file mode 100644 index 00000000..6c7443b1 --- /dev/null +++ b/src/deb/for-download/tools/patches/fix-fpm-poold.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +if [ -d "/etc/php" ]; then + OLDVAL='php_admin_value\[upload_max_filesize\] = 80M' + NEWVAL='php_admin_value\[upload_max_filesize\] = 800M' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + OLDVAL='php_admin_value\[post_max_size\] = 80M' + NEWVAL='php_admin_value\[post_max_size\] = 800M' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + OLDVAL='php_admin_value\[memory_limit\] = 256M' + NEWVAL='php_admin_value\[memory_limit\] = 512M' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + OLDVAL='pm.max_children = 8' + NEWVAL='pm.max_children = 3' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + OLDVAL='request_terminate_timeout = 90s' + NEWVAL='request_terminate_timeout = 360s' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + OLDVAL='php_admin_value\[max_execution_time\] = 30' + NEWVAL='php_admin_value\[max_execution_time\] = 300' + find /etc/php/*/fpm/pool.d/ -name "*.conf" -type f -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + find /usr/local/vesta/data/templates/web/apache2/ -type f -name "*.sh" -exec grep -l "$OLDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g" + + systemctl --full --type service --all | grep "php...-fpm" | awk '{print $1}' | xargs systemctl restart +fi + +if [ -f "/etc/apache2/mods-enabled/mpm_event.conf"]; then + sed -i "s#MaxRequestWorkers.*#MaxRequestWorkers 600#g" /etc/apache2/mods-enabled/mpm_event.conf + systemctl restart apache2 +fi