Overview
HTTP/2 (also written as HTTP2) is the second major version of the
Hypertext Transfer Protocol, the core protocol that powers the World Wide Web. Designed to
overcome the limitations of HTTP/1.1, HTTP/2 dramatically improves the speed, efficiency,
and performance of how data is transferred between clients (like browsers) and servers.
In this guide, we’ll explain what makes HTTP/2 better than its predecessor and walk you
through how to enable HTTP/2 on your WHM/cPanel server using EasyApache 4, a popular web
server configuration tool for Apache.
Key Benefits of HTTP/2
Switching to HTTP/2 on your cPanel server offers significant advantages
in both speed and efficiency. Here’s why upgrading is worth it:
- Reduced Network Latency :
HTTP/2 uses multiplexing, which allows multiple requests and responses to be sent
simultaneously over a single connection. This eliminates the wait time seen in HTTP/1.1,
where each request had to be processed sequentially. As a result, websites load faster
and feel more responsive.
- Request Prioritization :
HTTP/2 enables your server to prioritize important resources, ensuring that critical
content (like CSS, JavaScript, or above-the-fold content) loads first. This
significantly boosts page speed and improves user experience, especially on mobile and
slower networks.
- Header Compression :
By using a mechanism called HPACK, HTTP/2 compresses request and response headers. This
reduces data overhead, especially on websites with many requests, and helps lower
latency and bandwidth usage.
- Better Use of Network Resources :
Thanks to features like multiplexing and header compression, HTTP/2 allows for more
efficient use of server resources. It reduces CPU load, network congestion, and memory
usage — especially beneficial for high-traffic or resource-intensive websites.
How to
Enable HTTP/2 Using EasyApache 4 on WHM/cPanel
Enabling HTTP/2 on a WHM/cPanel server is a simple process if you're
using EasyApache 4, the recommended tool for managing Apache and PHP modules on cPanel
servers.
Follow these step-by-step instructions to activate HTTP/2 support and optimize your web
server for faster, more efficient performance:
Step-by-Step Guide to Enable HTTP/2 in
WHM
- Step 1: Log in to WHM as root
Access your WHM (Web Host Manager) panel by logging in with your root credentials.
- Step 2: Open EasyApache 4
You can find EasyApache 4 by typing it into the search bar, or by navigating to:
WHM → Software → EasyApache 4 - Step 3: Click “Customize”
Once you're inside EasyApache 4, click the “Customize” button located at the top right.
This will allow you to modify your current Apache configuration.
- Step 4: Navigate to “Apache Modules”
In the customization menu, select the “Apache Modules” tab. This section lists all
available Apache modules you can enable or disable.
- Step 5: Search for and Enable the HTTP/2 Module
Use the search bar to find the module named mod_http2.
Check the box next to HTTP/2 to enable it.
Attention:
You may see a warning or notice. Review it and click “Yes” to accept and proceed.
- Step 6: Review and Provision the Configuration
Click on the “Review” tab. If everything looks correct, click the “Provision” button to
begin applying the changes.
- Step 7: Wait for the Build Process to Complete
EasyApache 4 will now compile and apply the new Apache configuration. This may take
several minutes depending on your system.
- Step 8: Restart Apache
Once the build completes, go back to WHM and restart Apache to finalize the update. This
ensures HTTP/2 is fully enabled and active on your server.
Requirements to Enable HTTP/2 on WHM
Before enabling HTTP/2, make sure your server meets these version
requirements:
- Apache 2.4.17 or later
- OpenSSL 1.0.2 or newer
Both components are essential because HTTP/2 relies on TLS (SSL) and
other modern web technologies.
If your server uses cPanel with EasyApache 4, chances are it already supports these
versions. You can verify them using the command line or by checking your software
versions in WHM.
Method 2: Enable HTTP/2 Using the Command Line on Apache (Linux)
If you prefer working via the terminal or managing a cPanel server
without using the graphical WHM interface, you can manually enable HTTP/2 support in Apache
by configuring the appropriate modules. This method is especially useful for sysadmins who
need granular control over their server environment.
Follow the detailed steps below to enable HTTP/2 via command line on a WHM/cPanel server
running EasyApache 4.
Step-by-Step: Enabling mod_http2 from CLI
- Step 1: Log in to Your Server as Root
Use SSH to log in to your server with root privileges:
- Step 2: Check Your Current Apache MPM Module
To enable HTTP/2, your Apache must be using the mod_mpm_event module, which
supports multiplexing. HTTP/2 is not compatible with mod_mpm_prefork or
mod_mpm_itk.
Use one of the following commands to check which MPM module is active:
or (on some systems):
Look for output such as:
mpm_prefork_module (shared)
If you see mpm_prefork or mpm_itk, you'll need to remove them
before enabling HTTP/2.
- Step 3: Remove Incompatible MPM Modules
Remove the modules that conflict with HTTP/2 using the yum package manager:
yum remove ea-apache24-mod_mpm_prefork
yum remove ea-apache24-mod_mpm_itk
Note:
When prompted, type y and press Enter to confirm the removal.
- Step 4: Install HTTP/2-Compatible Modules
Now install the correct MPM module and enable HTTP/2:
yum install ea-apache24-mod_mpm_event
ea-apache24-mod_http2
This command ensures that your Apache installation can handle HTTP/2 connections by
using a compatible multiprocessing module and enabling the core HTTP/2 support.
- Step 5: Restart Apache to Apply Changes
Once the required modules are installed, restart Apache to activate the new
configuration:
Why Is mod_mpm_event Required for HTTP/2?
The mod_mpm_event module improves how Apache handles simultaneous
connections by enabling non-blocking I/O. HTTP/2 relies on this capability to allow features
like multiplexing and prioritized requests, which are not supported in older MPM modules
like prefork.
Conclusion
Enabling HTTP/2 on your WHM/cPanel server, whether through EasyApache 4
GUI or command line ensures faster loading times, reduced latency, and improved efficiency
for your websites.
By switching to the mod_mpm_event module and activating mod_http2, your Apache server
becomes capable of delivering modern performance standards expected by today's users and
search engines.
Whether you're hosting a single website or managing multiple high-traffic domains, HTTP/2 is
a must-have upgrade for any Linux-based web server.
Pro Tip from ServerMO:
After enabling HTTP/2, you can use free online tools like KeyCDN's HTTP/2 Test or run browser-based developer tools to confirm HTTP/2 is active on your domain.