HTTP/2 is a free latency win for any cPanel server with TLS already in place — same TLS handshake, multiplexed streams, header compression, server push for clients that support it. The cPanel toggle is two clicks. The supporting changes — the MPM choice, the keep-alive settings, and the per-vhost confirmation — are what most operators miss when they wonder why HTTP/2 is “enabled” but every connection is still negotiating HTTP/1.1.
What’s happening
mod_http2 is an Apache module that handles HTTP/2 frames on the same socket as HTTP/1.1, after ALPN negotiation during the TLS handshake. The client lists the protocols it supports; the server picks. If mod_http2 is loaded and Protocols h2 http/1.1 is set on the vhost, modern clients land on HTTP/2. HTTP/2 only works over TLS in practice (browser implementations require it), and it does not work under the prefork MPM with mod_php — the worker-per-connection model breaks the multiplexing assumption.
How to verify
Check what is loaded and what the vhost is offering:
apachectl -M | grep http2
rpm -qa | grep ea-apache24-mod-http2
apachectl -V | grep MPM
curl -v --http2 -I https://example.com/ 2>&1 | grep -E "^(< HTTP|ALPN|using HTTP)"
openssl s_client -alpn h2 -connect example.com:443 < /dev/null 2>&1 | grep ALPN
The curl line shows whether HTTP/2 actually upgraded. The openssl line shows what the server offers via ALPN.
The fix
- Confirm the MPM is event (or worker), not prefork. If prefork, swap to event first — see the dedicated MPM-switch article.
- Install
mod_http2via EasyApache 4: WHM > EasyApache 4 > Customize > Apache Modules > checkmod_http2> Provision. Or directly:yum install -y ea-apache24-mod-http2 && /scripts/rebuildhttpdconf && apachectl -t && apachectl graceful. - Enable HTTP/2 protocol negotiation. WHM > Apache Configuration > Include Editor > Pre Main Include > add:
This sets the protocol for every TLS-enabled vhost.Protocols h2 http/1.1 ProtocolsHonorOrder On H2WindowSize 65535 - Confirm with
curl -v --http2 -I https://example.com/— the response should containusing HTTP/2and the response status line should start withHTTP/2. - Verify HTTP/1.1 still works for legacy clients:
curl -v --http1.1 -I https://example.com/should succeed. - Tune keep-alive. HTTP/2 multiplexes, so
KeepAliveTimeout 5is too aggressive — the browser will reconnect mid-page-load. Bump to 30 in WHM > Apache Configuration > Global Configuration. - Save the EA4 profile so the
mod_http2package is captured.
For environments where HTTP/2 (and eventually HTTP/3) is part of the baseline, Stack Harbor sets these defaults during onboarding under cPanel server management.