]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/apache/recipes/default.rb
In Apache 2.4 disable all other MPMs except required
[chef.git] / cookbooks / apache / recipes / default.rb
index 4fa9b3bc38655f87ebd403992f70d5f078992715..ebf404945f165b2e9e8408dbe880e6ac5e6aed33 100644 (file)
 package "apache2"
 package "apache2-mpm-#{node[:apache][:mpm]}"
 
+#In Apache 2.4 mpm have become runtime loadable modules
+#Diable all mpm except the required mpm
+if node[:lsb][:release].to_f >= 14.04
+  mpms = ['event', 'itk', 'prefork', 'worker']
+  mpms.reject{|u| u == node[:apache][:mpm]}.each do |mpm|
+    apache_module mpm do
+      action [ :disable ]
+    end
+  end
+end
+
 admins = data_bag_item("apache", "admins")
 
 template "/etc/apache2/httpd.conf" do