From: Tom Hughes Date: Sun, 28 Feb 2021 19:12:34 +0000 (+0000) Subject: Switch forum to use a custom FPM pool with prometheus monitoring X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/2bf7f70d0b196960cfed948c888a437508abcaca?ds=sidebyside Switch forum to use a custom FPM pool with prometheus monitoring --- diff --git a/cookbooks/forum/recipes/default.rb b/cookbooks/forum/recipes/default.rb index 826310f73..728408a0c 100644 --- a/cookbooks/forum/recipes/default.rb +++ b/cookbooks/forum/recipes/default.rb @@ -21,7 +21,7 @@ include_recipe "accounts" include_recipe "apache" include_recipe "git" include_recipe "mysql" -include_recipe "php::apache" +include_recipe "php::fpm" cache_dir = Chef::Config[:file_cache_path] @@ -43,6 +43,12 @@ ssl_certificate "forum.openstreetmap.org" do notifies :reload, "service[apache2]" end +php_fpm "forum.openstreetmap.org" do + php_admin_values "open_basedir" => "/srv/forum.openstreetmap.org/html/:/usr/share/php/:/tmp/", + "disable_functions" => "exec,shell_exec,system,passthru,popen,proc_open" + prometheus_port 9253 +end + apache_site "forum.openstreetmap.org" do template "apache.erb" end diff --git a/cookbooks/forum/templates/default/apache.erb b/cookbooks/forum/templates/default/apache.erb index 82942001b..d51786b26 100644 --- a/cookbooks/forum/templates/default/apache.erb +++ b/cookbooks/forum/templates/default/apache.erb @@ -39,8 +39,9 @@ DocumentRoot /srv/forum.openstreetmap.org/html - ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/srv/forum.openstreetmap.org/html/:/usr/share/php/:/tmp/\ndisable_functions=exec,shell_exec,system,passthru,popen,proc_open" - ProxyFCGISetEnvIf "true" PHP_VALUE "upload_max_filesize=70M\npost_max_size=100M" + + SetHandler "proxy:unix:/run/php/forum.openstreetmap.org.sock|fcgi://127.0.0.1" +