Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP and FPM settings
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
max_execution_time = 600
memory_limit = 256M
max_input_vars = 3000
post_max_size = 64M
upload_max_filesize = 64M
# this gets overridden by a script located here:https://gist.github.com/mattzuba/430a3a0b4cd36a2cc1ac#file-01_httpd_phpfpm-config-L6-L22
"/etc/php-fpm-5.6.d/www.conf":
mode: "000644"
owner: root
group: root
content: |
[www]
user = webapp
group = webapp
listen = /var/run/php-fpm/php5-fpm.sock
listen.owner = webapp
listen.group = webapp
listen.mode = 0666
; These values are defauls, but dynamically configured by script above on deploymentsudo
pm = ondemand
pm.max_children = 430
pm.start_servers = 129
pm.min_spare_servers = 86
pm.max_spare_servers = 172
pm.max_requests = 500
pm.process_idle_timeout = 10s
ping.path = /ping
pm.status_path = /status
chdir = /
catch_workers_output = yes
php_admin_value[error_log] = /var/log/httpd/php-fpm.www.log
php_admin_flag[log_errors] = on
php_admin_flag[display_errors] = off
"/etc/httpd/conf.d/php.conf":
mode: "000644"
owner: root
group: root
content: |
<LocationMatch "/(ping|status)$">
Require ip 10.0.0.0/8
Require ip 127.0.0.1
</LocationMatch>
ProxyPassMatch ^/(ping|status)$ unix:/var/run/php-fpm/php5-fpm.sock|fcgi://localhost/
<FilesMatch \.php$>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ - [R=404,L]
SetHandler "proxy:unix:/var/run/php-fpm/php5-fpm.sock|fcgi://localhost"
</FilesMatch>
AddType text/html .php
DirectoryIndex index.php
"/etc/httpd/conf.d/realip.conf":
mode: "000644"
owner: root
group: root
content: |
RemoteIPHeader X-Forwarded-For
"/etc/httpd/conf.d/mpm.conf":
mode: "000644"
owner: root
group: root
content: |
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 150
ThreadLimit 32
ThreadsPerChild 32
MaxRequestWorkers 512
MaxConnectionsPerChild 0
ServerLimit 16
</IfModule>
"/etc/httpd/conf.d/www.conf" :
mode: "000644"
owner: root
group: root
content: |
Timeout 600
ProxyTimeout 600
VirtualHost stuff...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment