skip to content

HTTP2 on Apache - Linux

To enable http2 support on Apache you need to load the following two modules:

  • SSL
  • HTTP/2

To do so, run the following commands in your terminal

sudo a2enmod ssl


sudo a2enmod http2

Then activate the new modules by restarting Apache

sudo systemctl restart apache2

After activating the Apache modules, navigate to the Apache directory and edit the configuration. Simply add the following line to your global Apache configuration or inside an individual virtual hos.

Protocols h2 http/1.1


<VirtualHost *:443>

  DocumentRoot /var/www/public_html/
  SSLEngine on
  SSLCertificateKeyFile /path/to/private.pem
  SSLCertificateFile /path/to/cert.pem
  SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1

  Protocols h2 http/1.1