Apache 2.4.17:內建支援 HTTP/2

Zite 上突然看到 mod_h2 的文章,想說不是早就放出來很久了嗎... 仔細看才發現是 Apache HTTP Server 2.4.17 發行了:「how to h2 in apache」。

Support for HTTP/2 is finally being released with Apache httpd 2.4.17! This pages gives advice on how to build/deploy/configure it. The plan is to update this as people find out new things (read: bugs) or give recommendations on what works best for them.

另外在「Apache HTTP Server 2.4.17 Released」這邊可以看到公告,不過官方每次改版都直接改掉這個檔案 (沒有存檔),如果要看歷史紀錄的話到 Internet Archive: Wayback Machine 的頁面上看吧:「https://web.archive.org/web/*/https://www.apache.org/dist/httpd/Announcement2.4.html」。

這樣兩個主流 web server 都支援 HTTP/2 了,接下來最主要的問題是 Android 對 HTTP/2 的支援度:「HTTP/2 protocol」,要等舊版逐漸淘汰掉...

Apache 2.4...

如果要知道 Apache 2.4 有哪些與 2.2 不同的地方,看官方提供的「Overview of new features in Apache HTTP Server 2.4」會比起看新聞網站清楚。

對每個 SA 來說,重視的地方都會不太一樣。我認為有幾個比較重要的:

  • Event MPM:如果有 Event MPM,有機會比 Thread-based 的 Worker MPM 更省資源。
  • Asynchronous support:在 Event MPM 下一定要有的改善。
  • Reduced memory usage:要看看比起 2.2 可以省多少。
  • mod_proxy_fcgi:這樣就不需要 mod_fastcgi 了。
  • mod_remoteip:這樣就不用 mod_rpaf2 了。
  • mod_ratelimit:有點虛的功能,不過還是可以加減用用。

會選擇 Apache 其實最重要的原因是 .htaccess,他的效率只要好到使用的資源可以被 PHP 忽略就行了...