Use mod_proxy_fcgi for FCGI support with apache 2.4
authorTom Hughes <tom@compton.nu>
Fri, 29 Aug 2014 08:09:09 +0000 (09:09 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 29 Aug 2014 08:09:09 +0000 (09:09 +0100)
cookbooks/web/recipes/backend.rb
cookbooks/web/templates/default/apache.backend.erb

index b059d4f..7dc229e 100644 (file)
@@ -24,10 +24,16 @@ include_recipe "web::cgimap"
 
 web_passwords = data_bag_item("web", "passwords")
 
-apache_module "fastcgi-handler"
 apache_module "remoteip"
 apache_module "rewrite"
 
+if node[:lsb][:release].to_f >= 14.04
+  apache_module "proxy"
+  apache_module "proxy_fcgi"
+else
+  apache_module "fastcgi-handler"
+end
+
 apache_site "default" do
   action [ :disable ]
 end
index 7f3c397..336ab56 100644 (file)
   #
   RewriteRule ^/api/0\.6/map$ - [H=fcgi:127.0.0.1:8000]
   RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
+<% if node[:lsb][:release].to_f >= 14.04 -%>
+  RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ fcgi://127.0.0.1:8000$0 [P]
+  RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ fcgi://127.0.0.1:8000$0 [P]
+  RewriteRule ^/api/0\.6/(nodes|ways|relations)$ fcgi://127.0.0.1:8000$0 [P]
+<% else -%>
   RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ - [H=fcgi:127.0.0.1:8000]
   RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ - [H=fcgi:127.0.0.1:8000]
   RewriteRule ^/api/0\.6/(nodes|ways|relations)$ - [H=fcgi:127.0.0.1:8000]
+<% end -%>
 </VirtualHost>
 <% end -%>