Hi, I tried to enable http2 with apache2 but I couldn’t. I did this:

  • I activated http2 with this: sudo a2enmod http2
  • I added this line in my virtual host with 443 port: Protocols h2 http/1.1.

I have a ubuntu server 18.04.2 and apache 2.4.29, also i use letsencrypt for the site.

I need to do something else?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


That should be pretty much it.

You can now use your browser to check if the resources are actually going through http2. You can do that with the browsers developer tool, then go to the networking tab and try accessing your site, there you should see the protocol that is being used.

Note that the Protocol column might not be there, so you need to enable it, just right click on any of the other columns and choose tick the Protocol from the drop down.

Let me know how it goes!

  • Hi, thanks, I checked this but not work the http2, I think that I need to do someting else.

    • That is pretty much it, I have the same setup for my website actually. You can check it here:


      One thing that I could suggest is adding the Protocols h2 http/1.1 line in your Vhost for port 80 as well. Also did you restart apache after the changes?


      • Hi, yes I rebooted apache and server. This is my virtual host configuration (80 and 443):

        <VirtualHost *:80>
            ServerAdmin abc2039@gmail.com
            ServerName abc.com
            ServerAlias www.abc.com
            DocumentRoot /var/www/abc.com/html
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =abc.com [OR]
        RewriteCond %{SERVER_NAME} =www.abc.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
        <Directory /var/www/abc.com/>
            AllowOverride All
        Protocols h2 http/1.1
        <IfModule mod_ssl.c>
        <VirtualHost *:443>
            ServerAdmin xxxx9@gmail.com
            ServerName abc.com
            ServerAlias www.abc.com
            DocumentRoot /var/www/abc.com/html
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/abc.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/abc.com/privkey.pem
        Protocols h2 http/1.1

        And in apache2.conf I added “Protocols h2 h2c http/1.1”