Use mod_proxy_fcgi on 14.04
authorTom Hughes <tom@compton.nu>
Tue, 3 Jun 2014 18:18:00 +0000 (19:18 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 3 Jun 2014 18:18:00 +0000 (19:18 +0100)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/apache.erb

index 64e484b39adadcbcca48d720e3d9a5a369bef73f..ba010b0d6c5793a59f50bd396a1ef94f3a0765e3 100644 (file)
@@ -29,7 +29,13 @@ package "php-pear"
 package "php-apc"
 
 apache_module "rewrite"
-apache_module "fastcgi-handler"
+
+if node[:lsb][:release].to_f >= 14.04
+  apache_module "proxy"
+  apache_module "proxy_fcgi"
+else
+  apache_module "fastcgi-handler"
+end
 
 home_directory = data_bag_item("accounts", "nominatim")["home"]
 source_directory = "#{home_directory}/nominatim"
index 120bccececfa9b8c03c827e8a06d2b2360d0723a..8e12362d1f325b4effbf9ed13a76ceeedbf4e3eb 100644 (file)
         AddType text/html   .php
         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/
+<% else -%>
         AddHandler fcgi:/var/run/php5-fpm-www.sock .php
         AddHandler fcgi:/var/run/php5-fpm-www.sock .phpx
         AddHandler fcgi:/var/run/php5-fpm-www.sock .phpj
+<% end -%>
     </Directory>
 
     <% @pools.each do |name,details| -%>
     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/
+<% else -%>
         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .php
         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpx
         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpj
+<% end -%>
     </Location>
     <% end -%>