It is important to setup HTTP2 in Apache web server to improve speed and performance. HTTP/2 supports parallelism, header compression, binary data transfer, and also server push. In this article, we will look at how to enable HTTP2 in Apache web server.
Explanation: h2 is TLS-encrypted HTTP/2, h2c is cleartext HTTP/2, and http/1.1 is ordinary HTTP/1.1. Having http/1.1 at the end of the line provides a fallback to HTTP/1.1, while h2c is not strictly necessary. Step 5: Enable the modhttp2 Apache module. Now you can enable the http2 module in Apache: sudo a2enmod http2. HTTP/2 was integrated with Apache 2.4.17 version by enabling modhttp2 module also Curl 7.43.0 added support for HTTP/2. Almost, all the web browser started supporting HTTP/2 such as Chrome, Opera, Firefox, Internet Explorer 11 & Safari. As of November 2015 2.3% of the top 10 million websites supported HTTP/2. To use HTTP/2, it’s necessary to switch from the default prefork implementation to the Apache event or worker MPM. The Gentoo Wiki provides additional details here. With nghttp2 installed, let’s switch to the Apache event MPM and add http2 to the list of Apache modules we want to build. Enable HTTP/2 support with Apache NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks.
How To Enable HTTP2 in Apache

Here are the steps to enable HTTP2 in Apache web server. Please note, HTTP/2 is supported for HTTPS/SSL websites only. So please enable SSL in Apache web server before proceeding.
1. Enable http2 module
On Ubuntu/Debian
Open terminal and run the following command to enable http2 module.
On Redhat/CentOS/Fedora
Apache configuration file is located at one of the following locations, depending on your Linux distribution.
/etc/apache2/httpd.conf
/etc/apache2/apache2.conf
/etc/httpd/httpd.conf
/etc/httpd/conf/httpd.conf
Open terminal and run the following command to open Apache configuration page.

Look for the following line

Uncomment it by removing # at its beginning.
Also read : How to Enable Apache Server Status dashboard
2. Add Protocols directive
Also add the following line to your Apache server configuration file. This needs to be done for both Ubuntu/Debian as well Redhat/CentOS linux.
Add the above line to Apache server configuration file. If you have setup virtual host in Apache, then open your virtual configuration file and add the above line in <VirtualHost *:443> tag.
Also read : How to remove x-powered-by in Apache/PHP
3. Restart Apache Web Server
Restart Apache web server to apply changes. Https://www.dropbox.com/.
Also read : How to Disable HTTP OPTIONS methods in Apache

Enable Http2 Apache
4. Verify HTTP/2
Use a third party tools like KeyCDN HTTP2 checker that allow you to check if HTTP/2 is enabled on your website.
Dbpoweramp ar. After you enter your website, with HTTPS URL, it will tell you if HTTP/2 is enabled in it or not.
As you can see, it is quite easy to enable HTTP/2 in Apache.
Http2 Apache Centos 7
Ubiq makes it easy to visualize data in minutes, and monitor in real-time dashboards. Try it today!
Apache Version History
Related posts:
