How to configure http2 protocol on Apache2.4 web server

This is only available on Apache2.4.17 and above.
It will only work on Ubuntu 16.04 and above.

1 . First check the apache version

apache2 -v  

2 . If need to upgrade do the following

sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install apache2 -y

3 . Now you can enable http2 mod

sudo a2enmod http2

4 . And put this directive in your sites-available/000-default.conf file

Protocols h2 http/1.1

5 . Restart apache

sudo service apache2 restart