]> git.openstreetmap.org Git - chef.git/commitdiff
In Apache 2.4 disable all other MPMs except required
authorGrant Slater <git@firefishy.com>
Tue, 15 Jul 2014 08:00:33 +0000 (09:00 +0100)
committerGrant Slater <git@firefishy.com>
Tue, 15 Jul 2014 08:01:46 +0000 (09:01 +0100)
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