Enabling http/2 in Apache 2.4 does not work

前端 未结 1 1693
生来不讨喜
生来不讨喜 2020-12-21 09:08

We are trying to enable http/2 on Apache 2.4, but with no success. The server OS is FreeBSD 11.2, and the OpenSSL version is 1.0.2o.

We have a real and valid SSL Cer

相关标签:
1条回答
  • 2020-12-21 09:31

    Apache does not support HTTP/2 with prefork MPM. This was added in 2.4.27:

    *) COMPATIBILITY: mod_http2: Disable and give warning when using Prefork. The server will continue to run, but HTTP/2 will no longer be negotiated. [Stefan Eissing]

    The Prefork MPM is basically incompatible with the way HTTP/2 is implemented. There should be a warning in your error logs after restart telling you this.

    Prefork is also a very old MPM that is slow, so those sites that want HTTP/2 probably shouldn't be using it anyway. It should only really be used if you are running non-threadsafe PHP applications (threadsafe ones should move to Event MPM and php-fm (which is basically how Nginx runs as it does not offer a prefork equivalent). Unfortunately it is also the default on many Apache installs (just i case people use thread-unsafe PHP applications?), and often you cannot change it without downloading and recompiling it.

    More info on MPMs here: https://serverfault.com/questions/383526/how-do-i-select-which-apache-mpm-to-use

    0 讨论(0)
提交回复
热议问题