R
R
rgz2018-11-24 11:06:12
Apache HTTP Server
rgz, 2018-11-24 11:06:12

Trying to migrate to HTTP/2. What's my mistake?

Hello. There is a resource on vps:

  • debian 8
  • https (let's encrypt)
  • apache

Decided to switch to http/2:
Apache Server. Updated to 2.4.37.
enabled http2 module
a2enmod http2
Reloaded apachectl -t && systemctl restart apache2
Added config
bash -c 'cat >/etc/apache2/conf-available/http2.conf' <<EOF
Protocols h2 h2c http/1.1

H2Push          on
H2PushPriority  *                       after
H2PushPriority  text/css                before
H2PushPriority  image/jpeg              after   32
H2PushPriority  image/png               after   32
H2PushPriority  application/javascript  interleaved

SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite 'EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS'

EOF

Restarted apache. But the protocol is still http/1.1 . I cleared the
cache
. I also tried to add it to the virtualhost. The
Protocols h2 h2c http/1.1
mod is enabled (apache2ctl -M shows)
Question: what did I forget? Why does not it work?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey, 2018-11-25
@rgz

1. What version of Apache do you have? 2.4.24 or older?
2. http2 is simply enabled by adding the line Protocols h2 h2c http/1.1 to Apache's head config.
3. A banal question after editing the Apache config rebooted Apache? ssl certificates are cut right?
4. And finally, a banal question after editing the Apache config did you rebuild Apache?
5. If points 1-4 are OK, then you have mpm_prefork which is not compatible with http2, go to event . But you have to rebuild php / switch to php-fpm. (Well, of course Apache becomes essentially unnecessary)
6. You can check http2 Here
There can be no other options Most likely the problem is in the 5th paragraph described by me .

D
Dmitry Kuznetsov, 2018-11-24
@dima9595

And you tightened certificates in a config?

P
Puma Thailand, 2018-11-24
@opium

In site enabled enable http2 for https

R
rgz, 2018-11-25
@rgz

Solved a problem. If anyone is looking, here is the solution:
the "standard" Apache "prefork" module is not very compatible with HTTP/2, so you need to use a more suitable one. Turn off one, turn on the other, restart Apache.

sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
service apache2 restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question