1
0
Fork 0

Use PHP-FPM pooling

This commit is contained in:
Ainsley Ellis 2024-12-03 15:48:49 +00:00
parent 72d2524c22
commit 1167368f3a
3 changed files with 39 additions and 6 deletions

View file

@ -23,8 +23,28 @@
# Allow access to www/
Require all granted
# Pass HTTP Authorization headers to PHP-FPM
CGIPassAuth on
</Directory>
# PHP-FPM configuration
# See https://serverfault.com/questions/450628/apache-2-4-php-fpm-proxypassmatch/510784
# Required for FPM to receive POST data sent with Transfer-Encoding: chunked
SetEnv proxy-sendcl 1
# Forward all PHP requests to the php-fpm pool for this domain.
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/app.dev.sixfold.org.sock|fcgi://app.dev.sixfold.org"
Header set Cache-Control "no-store"
</FilesMatch>
# Set some proxy properties.
<Proxy "fcgi://app.dev.sixfold.org">
ProxySet connectiontimeout=5 timeout=240
</Proxy>
RewriteEngine On
<Files "errors/([0-9]+).php">

View file

@ -0,0 +1,19 @@
[app.sixfold.org]
user = www-data
group = www-data
listen = /run/php/app.sixfold.org.sock
listen.owner = www-data
listen.group = www-data
pm = ondemand
pm.max_children = 20
pm.process_idle_timeout = 30s
pm.max_requests = 200
request_slowlog_timeout = 10s
slowlog = /var/log/local/php-fpm-slow.log
catch_workers_output = yes
php_admin_value[include_path] = /srv/app.sixfold.org/lib
php_admin_value[auto_prepend_file] = config.php

View file

@ -13,14 +13,8 @@ expose_php = Off
post_max_size = 10M
upload_max_filesize = 6M
include_path = /srv/app.sixfold.org/lib
auto_prepend_file = config.php
[session]
session.use_strict_mode = Off
[Date]
date.timezone = Etc/UTC
[app]
app.site_status = "live"