Getting HTTP/2 Working on Apache 2.4.29 on Debian 8
I am trying to update my apache2 (Apache/2.4.29 (Debian 8))
server to support http2
but after enabling http2
with following code, it does not work because of mpm_prefork
does not support http2
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
</IfModule>
since mpm_prefork
apache (2.4.29) does not work with http2
, I tried using mpm_event
/mpm_worker
but it does not work, so I enable mpm_prefork
sudo a2dismod mpm_event
sudo a2dismod mpm_worker
sudo a2enmod mpm_prefork
Since I am still running php5
what should I do to have http2 support on Debian8?
Will I have to update php5 to php7?
Is there any workaround to use mpm_worker/mpm_event with php5 with http2 support?
apache error log
[http2:warn] [pid 11992] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[mpm_prefork:notice] [pid 11992] AH00163: Apache/2.4.29 (Debian) OpenSSL/1.1.0g configured -- resuming normal operations
[core:notice] [pid 11992] AH00094: Command line: '/usr/sbin/apache2'
Solution 1:
It's better to upgrade to php7. Install php7.x-fpm and use the mpm_event (or mpm_worker) module:
apt-get install php7.x-fpm # install the php-fpm
a2enmod proxy_fcgi
a2enconf php7.x-fpm
a2dismod php7.x # disables mod_php.
a2dismod mpm_prefork
a2enmod mpm_event # enable event MPM. You could also enable mpm_worker.