From 3f966bbd9c321ce5377e33b9f920984e2bdcef7b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 22 Jun 2018 09:07:16 +0100 Subject: [PATCH] Enable HTTP/2 over TLS on 18.04 --- cookbooks/apache/recipes/default.rb | 4 ++++ cookbooks/apache/templates/default/httpd.conf.erb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index 989755f67..bc0410fd3 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -36,6 +36,10 @@ apache_module "mpm_#{node[:apache][:mpm]}" do action [:enable] end +if node[:lsb][:release].to_f >= 18.04 + apache_module "http2" +end + admins = data_bag_item("apache", "admins") apache_conf "httpd" do diff --git a/cookbooks/apache/templates/default/httpd.conf.erb b/cookbooks/apache/templates/default/httpd.conf.erb index add175aa2..ded019d93 100644 --- a/cookbooks/apache/templates/default/httpd.conf.erb +++ b/cookbooks/apache/templates/default/httpd.conf.erb @@ -1,5 +1,10 @@ # DO NOT EDIT - This file is being maintained by Chef +<% if node[:lsb][:release].to_f >= 18.04 -%> +# Enable HTTP/2 over TLS +Protocols h2 http/1.1 + +<% end -%> # Set the number of seconds before receives and sends time out Timeout <%= node[:apache][:timeout] %> -- 2.43.2