From: Tom Hughes Date: Tue, 10 Jun 2014 11:31:53 +0000 (+0100) Subject: Use TCP/IP connections for FPM on 14.04 X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/720abae3e8f61545f741e649c38b810493790830 Use TCP/IP connections for FPM on 14.04 --- diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index bca915d91..3f490b272 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -67,7 +67,7 @@ node[:nominatim][:fpm_pools].each do |name,data| owner "root" group "root" mode 0644 - variables data.merge(:name => name) + variables data.merge(:name => name, :port => data[:port]) notifies :reload, "service[php5-fpm]" end end diff --git a/cookbooks/nominatim/templates/default/apache.erb b/cookbooks/nominatim/templates/default/apache.erb index 8e12362d1..c92e07325 100644 --- a/cookbooks/nominatim/templates/default/apache.erb +++ b/cookbooks/nominatim/templates/default/apache.erb @@ -28,9 +28,9 @@ AddType application/xml .phpx AddType application/json .phpj <% if node[:lsb][:release].to_f >= 14.04 -%> - ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php5-fpm-www.sock|fcgi://localhost<%= @directory %>/website/ - ProxyPassMatch ^/(.*\.phpx(/.*)?)$ unix:/var/run/php5-fpm-www.sock|fcgi://localhost<%= @directory %>/website/ - ProxyPassMatch ^/(.*\.phpj(/.*)?)$ unix:/var/run/php5-fpm-www.sock|fcgi://localhost<%= @directory %>/website/ + ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/ + ProxyPassMatch ^/(.*\.phpx(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/ + ProxyPassMatch ^/(.*\.phpj(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/ <% else -%> AddHandler fcgi:/var/run/php5-fpm-www.sock .php AddHandler fcgi:/var/run/php5-fpm-www.sock .phpx @@ -42,9 +42,9 @@ Alias /pool-<%= name %>/ "<%= @directory %>/website/" > <% if node[:lsb][:release].to_f >= 14.04 -%> - ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php5-fpm-<%= name %>.sock|fcgi://localhost<%= @directory %>/website/ - ProxyPassMatch ^/(.*\.phpx(/.*)?)$ unix:/var/run/php5-fpm-<%= name %>.sock|fcgi://localhost<%= @directory %>/website/ - ProxyPassMatch ^/(.*\.phpj(/.*)?)$ unix:/var/run/php5-fpm-<%= name %>.sock|fcgi://localhost<%= @directory %>/website/ + ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/ + ProxyPassMatch ^/(.*\.phpx(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/ + ProxyPassMatch ^/(.*\.phpj(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/ <% else -%> AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .php AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpx diff --git a/cookbooks/nominatim/templates/default/fpm.conf.erb b/cookbooks/nominatim/templates/default/fpm.conf.erb index c711ee84d..1aa405f59 100644 --- a/cookbooks/nominatim/templates/default/fpm.conf.erb +++ b/cookbooks/nominatim/templates/default/fpm.conf.erb @@ -1,7 +1,11 @@ ; DO NOT EDIT - This file is being maintained by Chef [<%= @name %>] +<% if @port -%> +listen = 127.0.0.1:<%= @port %> +<% else -%> listen = /var/run/php5-fpm-<%= @name %>.sock +<% end -%> user = www-data group = www-data diff --git a/roles/pummelzacken.rb b/roles/pummelzacken.rb index 341b87e27..622258615 100644 --- a/roles/pummelzacken.rb +++ b/roles/pummelzacken.rb @@ -39,10 +39,12 @@ default_attributes( }, :fpm_pools => { :www => { + :port => "8000", :pm => "dynamic", :max_children => "70" }, :bulk => { + :port => "8001", :pm => "static", :max_children => "10" }