add http2 for apache
authorIan Kelling <ian@iankelling.org>
Fri, 12 Aug 2016 20:40:03 +0000 (13:40 -0700)
committerIan Kelling <ian@iankelling.org>
Fri, 12 Aug 2016 20:41:18 +0000 (13:41 -0700)
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
 
     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
 if $ssl; then
     tee -a /etc/apache2/sites-enabled/$h.conf <<EOF
         SSLCertificateFile $cert_dir/$h-chained.pem