]> git.openstreetmap.org Git - chef.git/commitdiff
Use TCP/IP connections for FPM on 14.04
authorTom Hughes <tom@compton.nu>
Tue, 10 Jun 2014 11:31:53 +0000 (12:31 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 10 Jun 2014 11:31:53 +0000 (12:31 +0100)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/apache.erb
cookbooks/nominatim/templates/default/fpm.conf.erb
roles/pummelzacken.rb

index bca915d9145497894271112d5259834b95384135..3f490b2727741a1c2e8c8bef77459f31c6d6dfaa 100644 (file)
@@ -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
index 8e12362d1f325b4effbf9ed13a76ceeedbf4e3eb..c92e07325d4db9ba36a59275418dfc77e6eab1a0 100644 (file)
@@ -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/"
     <Location /pool-<%= name %>>
 <% 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
index c711ee84d7946c2b2145267fb747b7c62a31a0f4..1aa405f594ebee7f78f3e553b3a6e36178233af4 100644 (file)
@@ -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
index 341b87e27ad4a70d3e1475eded19dfb7ffeb060f..62225861510979311e0c9ae2f797bc2ad784c237 100644 (file)
@@ -39,10 +39,12 @@ default_attributes(
     },
     :fpm_pools => {
         :www => {
+            :port => "8000",
             :pm => "dynamic",
             :max_children => "70"
         },
         :bulk => {
+            :port => "8001",
             :pm => "static",
             :max_children => "10"
         }