Http2 Apache

Posted on  by 



HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode. Step 1: Install Apache2 Per default it will be apache2 version 2.4.41 what is enought for http2 support. Sudo apt install apache2. Hypertext Transfer Protocol Version 2 (HTTP/2) is the latest version of the HTTP protocol, published as an IETF standard in RFC 7540 in 2015. The focus of the protocol is on performance; specifically, end-user perceived latency, network and server resource usage.

Apache web server distributed in default software repositories of Ubuntu and Debian do not include modhttp2 needed to enable HTTP/2 functionality. You will need to add a third-party package source with latest Apache version that also inludes modhttp2.

Enable Http2 Apache Windows

In this tutorial we are going to provide you with step-by-step instructions on how to enable HTTP2 on a CentOS 7 VPS with WHM/cPanel and EasyApache 4 installed on it. HTTP2 is a major revision of the HTTP network protocol and its goal is to reduce the latency as well as to make the web applications faster by allowing multiple concurrent requests between the web browser and the server across a single TCP connection.

Log in to WHM

Log in to WHM at https://your_server_IP:2087 and go to Home >> Software >> EasyApache 4 >> Customize >> PHP versions and install php 7.x version (php70, php71 or php72). Also, it is a good idea to install the following PHP extensions:

Click on ‘Next’ , review the changes and click on ‘Provision’.

Http2 Apache

Then, go to Home >> Software >> MultiPHP Manager and set PHP 7 as default PHP version for your websites.

Enable HTTP2 via WHM:

Log in to WHM and go to Home >> Software >> EasyApache 4 >> Customize >> Apache modules , disable the mod_mpm_prefork if it is enabled , click on ‘review’ to review the changes and click on ‘Provision’.

Then, go to Home >> Software >> EasyApache 4 >> Customize >> Apache modules , search for ‘mod_http2’ module, and enable it:

Click on ‘Next’ , and click on ‘Provision’ to install and enable the ‘mod_http2’ Apache module.

Enable HTTP2 via command line:

You can also install mod_http2 Apache module on command line using the following commands:

You should see something like this:

Http2 apache debian

Enter quit to exit the yum shell:

Please make sure that there is a /etc/apache2/conf.d/http2.conf Apache configuration file with the following lines:

If there is no such file, create it, add the lines above and restart Apache for the changes to take effect:

Please note, most browsers only support HTTP/2 via encrypted (https) connections, so you need to have a valid SSL certificate installed on your website to see the benefits of the HTTP2 protocol.

That is it. HTTP2 is enabled on your cPanel server.

Apache Httpd Configuration Example

If you have a VPS with us, there is no need to enable HTTP2 on WHM/cPanel with EasyApache 4 yourself. Instead, you can ask our Linux Administrators to install these for you. They are available 24/7, and can help you out with any issues or requests that you have.

Http2 Apache Debian

P.S. If you like our blog posts, on how to enable HTTP2 on WHM/cPanel with EasyApache 4, we’d appreciate you sharing this post on social networks by using the shortcuts below, or you can post a comment under the share shortcuts. Thanks.





Coments are closed