Difference between revisions of "Enable HTTP2 Support in Apache"

From Sympl Wiki
Jump to navigation Jump to search
(starting page for http2)
(Tag: 2017 source edit)
 
(Tag: 2017 source edit)
Line 5: Line 5:
 
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 [https://httpd.apache.org/docs/2.4/howto/http2.html#mpm-config]. 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.
 
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 [https://httpd.apache.org/docs/2.4/howto/http2.html#mpm-config]. 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 ===
 
  
# The domains you want to test, for example <code>'''''www.example.com'''''</code> and <code>'''''example.com'''''</code>
 
# The IP address of your server (), or in the case of an [[IPv6-only]] configuration, the IP address of the proxy.
 
# 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 <code>C:\Windows\System32\Drivers\etc\hosts</code>.
 
 
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 (<code>#</code>).
 
 
Save the changes with File > Save.
 
 
==== MacOS & Linux ====
 
Use the command <code>sudo nano /private/etc/hosts</code> 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 (<code>#</code>).
 
 
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.
 
 
[[Category:How To]]
 
[[Category:How To]]

Revision as of 21:40, 10 April 2020

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.