1

I have a Debian 10 (had the exact same issue with Debian 9) running an Apache 2.4.38 web server. Apache modules mpm_event and http2 are installed and the websites are served through HTTPS.

I have added the http2 line in every Apache virtualhost conf file for each of my websites, like :

<VirtualHost *:12080>
    # HTTP2
    Protocols h2 h2c http/1.1
    ...

EDIT: When I tested with web-based online tools, I got the answer "HTTP/2 protocol is not supported / ALPN extension is not supported".

When I curl one of my website (curl -I -k https://mywebsite.com), I have the following response, obviously still in HTTP/1.1:

HTTP/1.1 200 OK
Date: Tue, 30 Jul 2019 03:14:37 GMT
Server: Apache/2.4.38 (Debian)
Set-Cookie: PHPSESSID=7ulo4hj17ukek6s15g99fc2812; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Upgrade: h2,h2c
Connection: Upgrade
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Set-Cookie: C00=; Expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/

Did I forget something to have HTTP/2?

In case, here is also the content of my /etc/apache2/mods-enabled/http2.conf file:

<IfModule !mpm_prefork>
    Protocols h2 h2c http/1.1
</IfModule>

EDIT: ALPN seems to be NOT enabled (don't know if that can be an explanation) and my OpenSSL version is 1.1.1c.

bolino
  • 295

3 Answers3

2

The server header : Upgrade: h2,h2c shows that the HTTP/2 protocol is available server-side ...

The problem is your curl command line and the fact that http/2 is usually negotiated and not always used immediately

See https://curl.haxx.se/docs/http2.html

curl offers the --http2 command line option to enable use of HTTP/2.

curl offers the --http2-prior-knowledge command line option to enable use of HTTP/2 without HTTP/1.1 Upgrade.

HBruijn
  • 84,206
  • 24
  • 145
  • 224
0

Make sure whether the module is enabled on your server.

#cat /etc/apache2/mods-enabled/http2.load 

Make sure the following line is there:

LoadModule http2_module /usr/lib/apache2/modules/mod_http2.so

# apache2ctl -M | grep http2 - If enabled, the Output similar to the following: http2_module (shared)

HBruijn
  • 84,206
  • 24
  • 145
  • 224
Ryan
  • 152
-1

Did you enable the http2 Apache module and restart the Apache service?

sudo a2enmod http2 sudo systemctl restart apache2

reference: https://www.howtoforge.com/how-to-enable-http-2-in-apache/

8ctopus
  • 271