From 7ebe049da32826028cab723019f14159dfcee8d1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 18 Feb 2020 19:59:12 +0000 Subject: [PATCH] Improve handling of apache mpm selection --- .kitchen.yml | 12 ------------ cookbooks/dmca/attributes/default.rb | 2 ++ cookbooks/donate/attributes/default.rb | 4 ++++ cookbooks/forum/attributes/default.rb | 4 ++++ cookbooks/mediawiki/attributes/default.rb | 2 +- cookbooks/piwik/attributes/default.rb | 2 ++ cookbooks/wordpress/attributes/default.rb | 2 +- roles/forum.rb | 1 - roles/foundation.rb | 1 - roles/piwik.rb | 1 - roles/tile.rb | 2 +- roles/wiki.rb | 9 +-------- 12 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 cookbooks/dmca/attributes/default.rb diff --git a/.kitchen.yml b/.kitchen.yml index 1fcc3f7d6..37f670c79 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -72,15 +72,9 @@ suites: - name: dmca run_list: - recipe[dmca::default] - attributes: - apache: - mpm: prefork - name: donate run_list: - recipe[donate::default] - attributes: - apache: - mpm: prefork - name: exim run_list: - recipe[exim::default] @@ -90,9 +84,6 @@ suites: - name: forum run_list: - recipe[forum::default] - attributes: - apache: - mpm: prefork - name: geoipupdate run_list: - recipe[geoipupdate::default] @@ -151,9 +142,6 @@ suites: - name: piwik run_list: - recipe[piwik::default] - attributes: - apache: - mpm: prefork - name: planet run_list: - recipe[planet::default] diff --git a/cookbooks/dmca/attributes/default.rb b/cookbooks/dmca/attributes/default.rb new file mode 100644 index 000000000..56bdf2134 --- /dev/null +++ b/cookbooks/dmca/attributes/default.rb @@ -0,0 +1,2 @@ +# Use prefork as PHP is to dumb for anything else +override[:apache][:mpm] = "prefork" diff --git a/cookbooks/donate/attributes/default.rb b/cookbooks/donate/attributes/default.rb index 8ce74ce41..b41666c72 100644 --- a/cookbooks/donate/attributes/default.rb +++ b/cookbooks/donate/attributes/default.rb @@ -1 +1,5 @@ +# Enable the "donate" role default[:accounts][:users][:donate][:status] = :role + +# Use prefork as PHP is to dumb for anything else +override[:apache][:mpm] = "prefork" diff --git a/cookbooks/forum/attributes/default.rb b/cookbooks/forum/attributes/default.rb index 0c376d592..d6beb41d2 100644 --- a/cookbooks/forum/attributes/default.rb +++ b/cookbooks/forum/attributes/default.rb @@ -1 +1,5 @@ +# Enable the "forum" role default[:accounts][:users][:forum][:status] = :role + +# Use prefork as PHP is to dumb for anything else +override[:apache][:mpm] = "prefork" diff --git a/cookbooks/mediawiki/attributes/default.rb b/cookbooks/mediawiki/attributes/default.rb index 59838f920..a7eab3291 100644 --- a/cookbooks/mediawiki/attributes/default.rb +++ b/cookbooks/mediawiki/attributes/default.rb @@ -5,7 +5,7 @@ default[:apt][:sources] = node[:apt][:sources] | ["mediawiki"] default[:accounts][:users][:wiki][:status] = :role # Use prefork as PHP is to dumb for anything else -default[:apache][:mpm] = "prefork" +override[:apache][:mpm] = "prefork" # Set mediawiki defaults default[:mediawiki][:user] = "wiki" diff --git a/cookbooks/piwik/attributes/default.rb b/cookbooks/piwik/attributes/default.rb index 09bdc32bb..80b8dba91 100644 --- a/cookbooks/piwik/attributes/default.rb +++ b/cookbooks/piwik/attributes/default.rb @@ -11,3 +11,5 @@ default[:piwik][:plugins] = %w[ VisitFrequency VisitorInterest VisitsSummary VisitTime WebsiteMeasurable Widgetize ] + +override[:apache][:mpm] = "prefork" diff --git a/cookbooks/wordpress/attributes/default.rb b/cookbooks/wordpress/attributes/default.rb index 9cd395648..856c99696 100644 --- a/cookbooks/wordpress/attributes/default.rb +++ b/cookbooks/wordpress/attributes/default.rb @@ -2,7 +2,7 @@ default[:accounts][:users][:wordpress][:status] = :role # Use prefork as PHP is to dumb for anything else -default[:apache][:mpm] = "prefork" +override[:apache][:mpm] = "prefork" # Set wordpress defaults default[:wordpress][:user] = "wordpress" diff --git a/roles/forum.rb b/roles/forum.rb index 8273fc47f..3b62fe5aa 100644 --- a/roles/forum.rb +++ b/roles/forum.rb @@ -3,7 +3,6 @@ description "Role applied to all forum servers" default_attributes( :apache => { - :mpm => "prefork", :timeout => 60, :keepalive => false, :prefork => { diff --git a/roles/foundation.rb b/roles/foundation.rb index 9a2c2e553..622083164 100644 --- a/roles/foundation.rb +++ b/roles/foundation.rb @@ -3,7 +3,6 @@ description "Role applied to all OSMF servers" default_attributes( :apache => { - :mpm => "prefork", :timeout => 60, :keepalive => false }, diff --git a/roles/piwik.rb b/roles/piwik.rb index 886784be0..e0bc6b96e 100644 --- a/roles/piwik.rb +++ b/roles/piwik.rb @@ -3,7 +3,6 @@ description "Role applied to all Piwik servers" default_attributes( :apache => { - :mpm => "prefork", :prefork => { :server_limit => 450, :max_request_workers => 450 diff --git a/roles/tile.rb b/roles/tile.rb index 9061e2bce..f089d08b2 100644 --- a/roles/tile.rb +++ b/roles/tile.rb @@ -11,7 +11,7 @@ default_attributes( } }, :apache => { - :mpm => "event", + :mpms => ["event"], :timeout => 60, :event => { :server_limit => 60, diff --git a/roles/wiki.rb b/roles/wiki.rb index 845f99fe2..acd0cef1c 100644 --- a/roles/wiki.rb +++ b/roles/wiki.rb @@ -8,14 +8,7 @@ default_attributes( } }, :apache => { - :mpm => "prefork", - :timeout => 30, - :event => { - :server_limit => 32, - :max_request_workers => 800, - :threads_per_child => 50, - :max_connections_per_child => 10000 - } + :timeout => 30 }, :elasticsearch => { :version => "5.x", -- 2.43.2