apache2 - http2 / h2 protocol configuration
In this short article, we would like show how to configure http2 protocol (called h2 over TSL) for Apache 2.4 server.
Read all sectons to know how to enable http2 / h2 protocol.
During configuration, the following software were used (treat it only as recommendation):
- Windows 10,
- Apache 2.4.39 installed as WampServer x64 (download link here),
- PHP 7.3.5 (is installed automatically with WampServer, we need to select it with context menu only).

http2 / h2 protocol requires HTTPS protocol. Go to this article to see how to configure it.
In this case we need to enable only one module: http2_module
.
We can do it in 2 ways:
- from context menu: Apache -> Apache modules -> http2_module
- from configuration file
c:\wamp64\bin\apache\apache2.4.39\conf\httpd.conf
by uncommenting following line:xxxxxxxxxx
1LoadModule http2_module modules/mod_http2.so
It is necessary to add inside VirtualHost
which provides HTTPS connection only one line that enables http2 / h2 protocol:
xxxxxxxxxx
Protocols h2 http/1.1
In my case c:\wamp64\bin\apache\apache2.4.39\conf\extra\httpd-vhosts.conf
file as last configuration contains following VirtualHost
:
xxxxxxxxxx
<VirtualHost *:443>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
SSLEngine on
SSLCertificateKeyFile "${INSTALL_DIR}/bin/apache/apache2.4.39/conf/cert/localhost.key"
SSLCertificateFile "${INSTALL_DIR}/bin/apache/apache2.4.39/conf/cert/localhost.crt"
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
Protocols h2 http/1.1
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Note: you can use
Protocols h2 h2c http/1.1
if you want to enable HTTP/2 over TCP too - read more here.
Most simple is to click Restart All Services item in WampServer context menu located in Windows try bar.
Use Google Chrome DevTools to check if http2 is enabled.
Note: to see how to verify http2 with openssl read this article.

Note: use right mouse button to display Protocol column.