include_recipe "apache"
include_recipe "geoipupdate"
include_recipe "mysql"
-include_recipe "php::apache"
+include_recipe "php::fpm"
passwords = data_bag_item("piwik", "passwords")
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
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
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>