今天早上,我致力于让我所有的网站都能通过HTTPS工作,我想利用这个机会切换到HTTP2。
我的服务器运行的是Debian8,我已经将Apache更新到2.4.29以获得H2支持。
我已经启用了http2 apache模块:
a2enmod http2Protocols 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'来源:https://www.shivering-isles.com/http-2-getting-ready-on-debian-with-apache2/
我还试着不使用这个配置文件,并在主h2c配置文件或虚拟主机中添加了“/1.1”,但它仍然是一样的。
知道为什么Apache提供的是HTTP/1.1而不是H2吗?
发布于 2018-09-04 21:51:44
你在mpm_event上运行apache2吗?然后,您还需要为PHP启用fastcgi处理程序,激活PHP-fpm的配置,并禁用PHP apache2模块。
您的命令将如下所示:
root@host:/etc/apache2# a2dismod php7.2
root@host:/etc/apache2# a2enmod proxy proxy_fcgi
root@host:/etc/apache2# a2enconf php7.2-fpm
root@host:/etc/apache2# a2dismod mpm_prefork
root@host:/etc/apache2# a2enmod mpm_event
Enabling module mpm_event.
To activate the new configuration, you need to run:
systemctl restart apache2
root@host:/etc/apache2# systemctl restart apache2将PHP版本号(我使用7.2)替换为您的版本。如果您需要的话,还有一些更深层次的PHP fcgi配置配置,请在评论中告诉我。
https://stackoverflow.com/questions/49875304
复制相似问题