Apache Ubuntu

Upgrading HTTP request version from HTTP/1.1 to HTTP/2.0

Written by Deep

Now a days everyone want to open his website more Fast and quick load its assets. For this your one need could be of using HTTP/2.0

What is HTTP/2.0 ? 

HTTP/2 is a major revision of HTTP, developed for fast devlivery, reduce latency and minimize the protocol overheading. This works on Transport layer.

Features of HTTP/2:

  • Reduces latency for fast loading the page.
  • Multiplexing of request and response.
  • Header compression
  • Prioritizing the requests
  • It can be used over Secure (HTTPS) with TLS and non-secure (HTTP) protocols, but all the major browsers like Mozilla, Chrome, IE,Safari, Edge had stated that they will supoort HTTP/2 only with Secure Version of HTTP means HTTPS with TLS). Thus HTTPS is mandatory for using HTTPS over these browsers.

Getting started to upgrade:

Here is the process to upgrade the HTTP version of your Apache from HTTP/1.1 to HTTP/2.0 on Ubuntu.

  1. Install / Upgrade to latest version of Apache:
    Check the latest version with:
    If need upgrade then use the following command:
    Or, alternativly you can use to install above:
    Once the PPA is added, upgrade your system
  2. Enable FASTCgi
    If you are already using the module php7.1-fpm then skip this step. Here I am using PHP-7.1 on my server. You can respectivly change the version as per your requirement.If you have not installed the above module then follow these steps:
    (replace with 7.0 if needed). Enable proxy_fcgi and setenvif also.
    Now enable above installed module
    Disable PHP module for some time, we will restart it lateron
    Restart apache
  3. Switch the Multi-Processing Module from prefork to event or worker:
    As the HTTP/2 does not support prefork we have to switch this apache module to “event” or “worker”.
    Restart Apache and PHP 7.1
  4.  Update your Virtual-hosts or root host
    If you want the HTTP/2 on individual host then put the following command anywhere between <VirtualHost>………</VirtualHost> tags.
    Or if you want to apply it on all your websites then append above code in global /etc/apache2/apache2.conf
  5.  Time to enable http2 module and restart your server
    You can now verify by hitting your website’s URL (hosted on this server)  in your browser and INSPECT ELEMENT tool.


Leave a Comment