From 3b9afa09fa710d6845058d1befe1d75587992a53 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 1 Jul 2013 19:43:53 +0200 Subject: [PATCH] put nominatim's php-fpm config under chef control --- cookbooks/nominatim/recipes/default.rb | 18 ++++++++++++++++++ .../nominatim/templates/default/fpm.conf.erb | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 cookbooks/nominatim/templates/default/fpm.conf.erb diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index d15f3284f..0d653c638 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -39,6 +39,24 @@ apache_site "nominatim.openstreetmap.org" do directory "/home/lonvia/nominatim" end +template "/etc/php5/fpm/pool.d/www.conf" do + source "fpm.conf.erb" + owner "root" + group "root" + mode 0644 + variables :name => "www", :pm => "dynamic", :max_children => "50" + notifies :reload, resources(:service => "php5-fpm") +end + +template "/etc/php5/fpm/pool.d/bulk.conf" do + source "fpm.conf.erb" + owner "root" + group "root" + mode 0644 + variables :name => "bulk", :pm => "static", :max_children => "7" + notifies :reload, resources(:service => "php5-fpm") +end + postgresql_user "tomh" do cluster "9.1/main" superuser true diff --git a/cookbooks/nominatim/templates/default/fpm.conf.erb b/cookbooks/nominatim/templates/default/fpm.conf.erb new file mode 100644 index 000000000..78b1c01a5 --- /dev/null +++ b/cookbooks/nominatim/templates/default/fpm.conf.erb @@ -0,0 +1,16 @@ +; DO NOT EDIT - This file is being maintained by Chef + +[<%= @name %>] +listen = /var/run/php5-fpm-<%= @name %>.sock + +user = www-data +group = www-data + +pm = <%= @pm %> +pm.max_children = <%= @max_children %> +pm.start_servers = 20 +pm.min_spare_servers = 20 +pm.max_spare_servers = 30 +pm.max_requests = 1000000 + +security.limit_extensions = .php .phpx .phpj -- 2.39.5