Added Custom php pools to all available CMS's

This commit is contained in:
2020-07-17 15:52:34 +02:00
parent d246815e90
commit a3be7f3e18
13 changed files with 105 additions and 33 deletions

View File

@@ -0,0 +1,20 @@
[SITEname]
user = SITEname
group = SITEname
listen = /var/run/php/phpPHPver-fpm-SITEname.sock
listen.owner = www-data
listen.group = www-data
php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log
php_admin_value[cgi.fix_pathinfo] = 0
php_admin_value[post_max_size] = 512M
php_admin_value[upload_max_filesize] = 1G
php_admin_value[memory_limit] = 512M
php_admin_value[max_input_vars] = 10000
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

View File

@@ -24,7 +24,7 @@ location ~* \.(css|gif|ico|jpeg|jpg|js|png|svg|webp|eot|otf|woff|woff2|ttf|ogg)$
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/phpPHPver-fpm.sock;
fastcgi_pass unix:/var/run/php/phpPHPver-fpm-SITEname.sock;
}
location ~ /\.ht {

View File

@@ -24,5 +24,13 @@ wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/WordPress-unconfigured -O
sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' -e 's/DBName/'$db_name'/' -e 's/DOMAINname/'$domain'/' /var/www/"$domain"/html/wp-config.php
printf '%s\n' "g/WPsalty/d" a "$WPSalts" . w | ed -s /var/www/"$domain"/html/wp-config.php
#PHP Pool
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
groupadd "$sitename"
useradd -g "$sitename" "$sitename"
systemctl reload php"$phpver"-fpm
#Setting Permsissions
chown www-data:www-data -R /var/www/"$domain"/html
chown "$sitename":"$sitename" -R /var/www/"$domain"/html

View File

@@ -1,15 +1,7 @@
#Configuring PHP
if [ -z ${ignphpcms+x} ]; then ignphpcms=0;fi
if [ $ignphpcms != 1 ]; then
sed -i '/upload_max_filesize/c\upload_max_filesize = 1G' /etc/php/"$phpver"/fpm/php.ini
sed -i '/post_max_size/c\post_max_size = 512M' /etc/php/"$phpver"/fpm/php.ini
sed -i '/memory_limit/c\memory_limit = 512M' /etc/php/"$phpver"/fpm/php.ini
fi
#Configuring nginx
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Nginx-unconfigured -O /tmp/nginx-siteconf
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' /tmp/nginx-siteconf
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-enabled/"$domain"
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$domain"
#Reloading Services
systemctl reload nginx php$phpver-fpm