mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Create fix-fpm-poold.sh
This commit is contained in:
parent
8791d471c6
commit
c182d7f0a7
1 changed files with 40 additions and 0 deletions
40
src/deb/for-download/tools/patches/fix-fpm-poold.sh
Normal file
40
src/deb/for-download/tools/patches/fix-fpm-poold.sh
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue