If you have just purchased your VPS or Dedicated server account, then congratulations you do not need to install HTTP/2 as it is already included. However, if you need to install it then it is a fairly simple process. You will need to have EasyApache 4 please review the instructions and conditions below if you need to install HTTP/2.
- Login to SSH as the root user
- Run the following command: yum install ea-apache24-mod_http2
Enable HTTP/2 in Easy Apache4
- Log into Web Host Manager (WHM)
- Select EasyApache 4
- Beside Currently Installed Packages, select Customize
- Select Apache Modules
- Search “http2”
- Toggle mod_http2 to blue
- Select Yes if you’re prompted to remove conflicting packages such as PHP 7.1 and a Multi-Processing Module (MPM) package, Continue, and select another Apache MPM package
- Select Review at the bottom
- Select Provision
- Select Done
Important conditions for HTTP/2 installation
- If you are using NGINX web server configured for port 80, you do not need to install HTTP/2 support for Apache as it is included in the default NGINX configuration. The installation of HTTP/2 in this type of configuration will cause secure connection issues with the Apple Safari internet browser in the Mac Operating System (OS 10+).
- If you install NGINX for your InMotion Hosting account, then it will automatically remove the HTTP/2 package for the Apache Web Server.
- Remember that the domain using HTTP/2 must have a valid SSL certificate for HTTP/2 to work properly.
- Apache offers three MPM modules: Prefork, Worker, and Event. HTTP/2 on Apache does not support the mpm_prefork module but you can use mpm_worker in its place. You can find more information on the different Multi-processing Modules (MPM) here. The removal of the mpm_prefork module will affect how your PHP code is handled. If you are not familiar with the multiprocessing modules and how it affects your PHP installation then consult with an experienced developer. You can also find more information on the different PHP handlers in this article: Choosing the best PHP handler.You can remove the mpm_prefork module by using the following command:
yum remove ea-apache24-mod_mpm_prefork
You should now be able to install HTTP/2 support on your VPS/Dedicated server account. For further reading on enabling HTTP/2 in Apache, please see How to enable HTTP/2 support in Apache.