Enable HTTP2 Support in Apache

From Sympl Wiki
Revision as of 21:40, 10 April 2020 by 6np (talk | contribs) (starting page for http2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We managed to get http2 running one time for some developers who were working on PUSH in the Apache Web Server. I didn't document what we did at the time but have rerun the process since on a fresh Sympl server to test for this documentation. There are a few things that need to be mentioned before we start as there are some substantial changes to the system that need to be made for this to work.

MPM_event to replace MPM_prefork

The prefork MPM has substantial limitations when working with http2 namely in that each connection can only handle one request at a time. More details can be found [1]. Because of this we are going to switch the apache server to using the event MPM. The event MPM is not able to preload the PHP module so we will also need to install php-fpm to parse php on the server.

You will need

  1. The domains you want to test, for example www.example.com and example.com
  2. The IP address of your server (), or in the case of an IPv6-only configuration, the IP address of the proxy.
  3. Admin access to your computer/laptop running Windows, MacOS or Linux.

Eidting the Hosts File

Windows

Open Notepad as an Administrator, and open the file C:\Windows\System32\Drivers\etc\hosts.

Add a new line for each hostname you want to override, with the IP Address, followed by spaces or tabs, then the hostname, for example:

198.51.100.62        www.example.com
198.51.100.62        example.com

Comments can be added by preceding them with a hash (#).

Save the changes with File > Save.

MacOS & Linux

Use the command sudo nano /private/etc/hosts to open the file.

Add a new line for each hostname you want to override, with the IP Address, followed by spaces or tabs, then the hostname, for example:

198.51.100.62        www.example.com
198.51.100.62        example.com

Comments can be added by preceding them with a hash (#).

Save the changes by Pressing Ctrl-x and when prompted, confirm with y.

Reverting Changes

Remember that this will continue to override any changes to DNS, so you should revert these changes as soon as possible otherwise your view of the internet will be incorrect.

To do so, simply edit the file again, and remove (or comment out) the relevant lines.