]> git.openstreetmap.org Git - chef.git/commitdiff
Use a custom FPM pool for piwik.openstreetmap.org
authorTom Hughes <tom@compton.nu>
Sun, 6 Dec 2020 10:55:41 +0000 (10:55 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 6 Dec 2020 10:55:41 +0000 (10:55 +0000)
cookbooks/piwik/recipes/default.rb
cookbooks/piwik/templates/default/apache.erb

index 948c03af41b00fa964131bc8af9afcde536a926e..0bd3ede877e3fad2259b7e5d5370cbfb738acda4 100644 (file)
@@ -20,7 +20,7 @@
 include_recipe "apache"
 include_recipe "geoipupdate"
 include_recipe "mysql"
-include_recipe "php::apache"
+include_recipe "php::fpm"
 
 passwords = data_bag_item("piwik", "passwords")
 
@@ -103,7 +103,7 @@ end
 
 link "/srv/piwik.openstreetmap.org" do
   to "/opt/piwik-#{version}/piwik"
-  notifies :restart, "service[apache2]"
+  notifies :restart, "service[php#{node[:php][:version]}-fpm]"
 end
 
 mysql_user "piwik@localhost" do
@@ -119,6 +119,10 @@ ssl_certificate "piwik.openstreetmap.org" do
   notifies :reload, "service[apache2]"
 end
 
+php_fpm "piwik.openstreetmap.org" do
+  prometheus_port 9253
+end
+
 apache_site "piwik.openstreetmap.org" do
   template "apache.erb"
 end
index 58703f41b53622f73c5db8643bb3abaaa70abdb3..f513ce9c2c8ddfc4d49d2ee9d498669b7fa550b5 100644 (file)
@@ -50,4 +50,8 @@
                ExpiresDefault "access plus 1 week"
                Header set Cache-Control "max-age=604800"
        </FilesMatch>
+
+        <FilesMatch ".+\.ph(ar|p|tml)$">
+                SetHandler "proxy:unix:/run/php/piwik.openstreetmap.org.sock|fcgi://127.0.0.1"
+        </FilesMatch>
 </Directory>