From: Grant Slater Date: Tue, 15 Jul 2014 08:00:33 +0000 (+0100) Subject: In Apache 2.4 disable all other MPMs except required X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/29312d8acdaae23bf07bcb5fc0627ffc2d53e4e6?ds=inline In Apache 2.4 disable all other MPMs except required --- diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index 4fa9b3bc3..ebf404945 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -20,6 +20,17 @@ 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