add http2 for apache
[basic-https-conf] / apache-site
index 90a98372dbf2c3a48052f239613b579b98161e68..aaefd9ee7beafc5fc7815597b647f36560a8bb1d 100755 (executable)
@@ -103,6 +103,15 @@ if [[ $extra_settings ]]; then
     cat -- $extra_settings | tee -a /etc/apache2/sites-enabled/$h.conf
 fi
 
+# go faster!
+if [[ -e /etc/apache2/mods-available/http2.load ]]; then
+    # https://httpd.apache.org/docs/2.4/mod/mod_http2.html
+    a2enmod http2
+tee -a /etc/apache2/sites-enabled/$h.conf <<EOF
+        Protocols h2 http/1.1
+EOF
+fi
+
 if $ssl; then
     tee -a /etc/apache2/sites-enabled/$h.conf <<EOF
         SSLCertificateFile $cert_dir/$h-chained.pem