Configure mod_http2 to enable HTTP/2 support in Apache httpd.
Configure SSL/TLS settings, as many web browsers support HTTP/2 only over HTTPS connections.
mod_http2 (If Necessary)On RHEL 9 / CentOS Stream 9, mod_http2 is typically installed with the httpd package, but if it's not installed, you can install it.
# Install mod_http2
[root@www ~]# dnf -y install mod_http2
mod_http2Configure mod_http2 for each virtual host as needed.
# Verify if mod_http2 is enabled
[root@www ~]# cat /etc/httpd/conf.modules.d/10-h2.conf
LoadModule http2_module modules/mod_http2.so
# Configure mod_http2 in virtual host
[root@www ~]# vi /etc/httpd/conf.d/dlp.emc.world.conf
# Add the Protocols line within the VirtualHost directive
<VirtualHost *:443>
Protocols h2 http/1.1
...
SSLCertificateChainFile /etc/letsencrypt/live/dlp.emc.world/chain.pem
</VirtualHost>
# Restart httpd to apply changes
[root@www ~]# systemctl restart httpd
# Verify that HTTP/2 is enabled
[root@www ~]# curl -I https://dlp.emc.world/
HTTP/2 200
...
HTTP/2 can be confirmed in the response header. For instance, when accessing using Google Chrome, if HTTP/2 is enabled, the "Protocol" in the response header will be indicated as "h2".
This setup enables HTTP/2 for Apache httpd, providing improved performance and efficiency for web communication. Remember to ensure SSL/TLS is properly configured as HTTP/2 largely operates over secure connections.