跳到主要內容區塊
:::
首頁 文章分享列表 文章分享

Apache使用HTTP/2

以CentOS為例

要使用HTTP2 Apache版本必須為2.4.17之後的版本

建議至少使用2.4.38以後的版本

且必須使用SSL憑證的https

首先若Apacha版本為較舊的版本

我們先手動升級

cd /etc/yum.repos.d

wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

yum install httpd

service httpd restart

接著在Apache設定檔中加入 Protocols h2 http/1.1

<VirtualHost *:443>
    Protocols h2 http/1.1
    ServerName www.weiyuan.com.tw
    略.....
</VirtualHost>

接著重新啟動apache

service httpd restart

最後可以線上測試HTTP2是否正常

網址: https://http2.pro/

這篇文章是否對您有幫助?
Line線上詢價 線上詢價
電子郵件
電話
聯繫我們