Debian 12 bookworm
Sponsored Link

Apache2 : Configure mod_http22023/07/04

Configure [mod_http2] to use HTTP/2.
Configure SSL/TLS settings, refer to here.
(many Web browsers support HTTP/2 only on HTTPS connection)
[2] Configure [mod_http2].
It's possible to set it for each virtual hostings.
# configure [mod_http2] to any virtual host sites you'd like to set

vi /etc/apache2/sites-enabled/
# add [Protocols ***] line

<VirtualHost *:443>
    Protocols h2 http/1.1
    DocumentRoot /var/www/dlp
    ErrorLog /var/log/apache2/dlp_ssl_error_log
    CustomLog /var/log/apache2/dlp_ssl_access_log combined
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/
    SSLCertificateKeyFile /etc/letsencrypt/live/
    SSLCertificateChainFile /etc/letsencrypt/live/

<Directory "/var/www/dlp">
    Options FollowSymLinks
    AllowOverride All
    Require all granted

a2enmod http2

Enabling module http2.
To activate the new configuration, you need to run:
  systemctl restart apache2

systemctl restart apache2
# verify accesses
# OK if [Upgrade: h2] is shown

curl -I

HTTP/1.1 200 OK
Date: Tue, 04 Jul 2023 01:49:46 GMT
Server: Apache
Upgrade: h2
Connection: Upgrade
Last-Modified: Tue, 04 Jul 2023 01:49:20 GMT
ETag: "0-5ff9f7de46312"
Accept-Ranges: bytes
Content-Type: text/html
Matched Content