HTTP/2 が、いつの間にか無効状態になっていまして…

ふと気がつくと、以前 HTTP/2 対応に設定した Apache2 が HTTP/2 でのアクセスが出来ないようなってて、「設定書き換えたわけではないんだけどな〜」と思いつつ、ログをチェックして HTTP/2 が効かなくなってる時期を特定。
その前後でパッケージのアップデートしてないかチェックしたら、Apache2 のパッケージをアップデートしていたのが判ったので、一旦 2.4.27 から 2.4.25 にダウングレードしてみたら、何の問題もなく HTTP/2 でアクセスが出来るように…。

バクだったら、レポートしといたほうがいいよな、と考えつつ、こんな

tweet しておいたら、以下のような情報を教えていただいた。

早速、チェックしてみたら

*) 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]

[From CHANGES_2.4.27]

これがまさに、ビンゴ、ってことで、慌てて Apache2 を mpm_prefork を使わない構成に変更した次第。


今回は、 prefork から worker に変更したんですが、それに合わせて FastCGI 対応と PHP7.0 の fpm 対応をして(この辺、作業メモ取り忘れてた…)、さぁ Apache 再起動! と思ったら

root@vps2:~# apache2ctl graceful
[Tue Aug 15 22:41:35.076681 2017] [alias:warn] [pid 1363:tid 140095758431424] AH00671: The Alias directive in /etc/apache2/mods-enabled/alias.conf at line 14 will probably never match because it overlaps an earlier Alias.
AH00526: Syntax error on line 12 of /etc/apache2/conf-enabled/zabbix_web.conf:
Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'graceful' failed.
The Apache error log may have more information.

と、Zabbix を動作させるための設定でオカシイがある、とエラーが。
これについては、 /etc/apache2/conf-enabled/zabbix_web.conf 内の "php_value" で指定されているパラメータの設定値を /etc/php/7.0/fpm/php.ini のほうで設定するようにして、/etc/apache2/conf-enabled/zabbix_web.conf ではコメントアウト。

これで、Apache2 の起動・再起動が行えるようになるので、再起動を実施。(更に、パッケージも再アップデート。)
ちゃんと、HTTP/2 でアクセスできるようになっているのかを確認して、問題なければ終わり、と。

root@vps2:~# curl --http2 -vIL https://www.downtown.jp/
* Trying 2401:2500:102:2120:153:120:6:47...
* TCP_NODELAY set
* Connected to www.downtown.jp (2401:2500:102:2120:153:120:6:47) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=www.downtown.jp
* start date: May 21 09:00:00 2017 GMT
* expire date: Aug 19 09:00:00 2017 GMT
* subjectAltName: host "www.downtown.jp" matched cert's "www.downtown.jp"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55e6dc825cd0)
> HEAD / HTTP/2
> Host: www.downtown.jp
> User-Agent: curl/7.55.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
HTTP/2 200
< date: Tue, 15 Aug 2017 13:48:44 GMT
date: Tue, 15 Aug 2017 13:48:44 GMT
< server: Apache/2.4.27 (Debian)
server: Apache/2.4.27 (Debian)
< last-modified: Sat, 13 May 2017 15:14:51 GMT
last-modified: Sat, 13 May 2017 15:14:51 GMT
< etag: "33d5-54f694896203c"
etag: "33d5-54f694896203c"
< accept-ranges: bytes
accept-ranges: bytes
< content-length: 13269
content-length: 13269
< cache-control: max-age=0
cache-control: max-age=0
< expires: Tue, 15 Aug 2017 13:48:44 GMT
expires: Tue, 15 Aug 2017 13:48:44 GMT
< vary: Accept-Encoding
vary: Accept-Encoding
< strict-transport-security: max-age=31536000; includeSubDomains; Preload
strict-transport-security: max-age=31536000; includeSubDomains; Preload
< content-type: text/html
content-type: text/html

<
* Connection #0 to host www.downtown.jp left intact

sid 使ってるせいもあるのか、気軽にパッケージアップデートやってると、たまにハマるんですよねぇ…。まぁ、仕方ないっちゃ仕方ないんですけど。
#流石に、仕事ではお気軽にアップデートしたりしませんよ。

トラックバック(1)

今回やりたいこと しばらく前から、自分のところは HTTP/2 対応が完了していたんですが、apache2 パッケージを 2.4.27-* にアップデート... 続きを読む

コメントする