]> git.openstreetmap.org Git - chef.git/commitdiff
Switch forum to use a custom FPM pool with prometheus monitoring
authorTom Hughes <tom@compton.nu>
Sun, 28 Feb 2021 19:12:34 +0000 (19:12 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 28 Feb 2021 19:13:03 +0000 (19:13 +0000)
cookbooks/forum/recipes/default.rb
cookbooks/forum/templates/default/apache.erb

index 826310f737ef2ea820e154685b94d5a14c78257b..728408a0c8d7e91e2be06398fba86a4ed0a67ada 100644 (file)
@@ -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
index 82942001bb4b580a5ff4e6527811d71b4bfe2174..d51786b26b707487bff0f29661dff8d3c396e84f 100644 (file)
@@ -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"
+       <FilesMatch ".+\.ph(ar|p|tml)$">
+               SetHandler "proxy:unix:/run/php/forum.openstreetmap.org.sock|fcgi://127.0.0.1"
+       </FilesMatch>
 </VirtualHost>
 
 <Directory /srv/forum.openstreetmap.org/html>