«

»

Eyl 14

Nginx – php-fpm ayarları

sudo find / \( -iname “php.ini” -o -name “www.conf” \)

/etc/php/7.4/fpm/pool.d/www.conf
/etc/php/7.4/fpm/php.ini
/etc/php/7.4/cli/php.ini

pico /etc/nginx/conf.d/moodle.xx.xx veya /etc/nginx/sites-enabled/moodle.xx.xx

location ~ [^/].php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

grep ^[^\;] /etc/php/7.4/fpm/pool.d/www.conf
[www]
user = www-data
group = www-data
listen = /run/php/php7.4-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

Nginx 504 timeout genelde bu max_xhildren sayısı yetersiz kalınca php7.4-fpm servisi durmasından kaynaklanıyor. Bununla ilgili https://geekflare.com/php-fpm-optimization/, https://haydenjames.io/php-fpm-tuning-using-pm-static-max-performance/ ve benzeri sayfalardan detaylı bilgilere ulaşmanız mümkün.

server {
root /var/www/moodle;
index index.php index.html index.htm;
server_name moodle.xx.xx;
client_max_body_size 100M;
autoindex off;
location / {
try_files $uri $uri/ =404;
# try_files $uri $uri/ /index.php$is_args$args;
}
location /dataroot/ {
internal;
alias /var/www/moodledata/;
}
location ~ [^/].php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
listen 80; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/moodle.xx.xx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/moodle.xx.xx/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

AlphaOmega Captcha Classica  –  Enter Security Code
     
 

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>