Hisashi Morita ([info]hisashim) wrote,
@ 2007-05-23 22:50:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
[SysAdmin][Pitfall][Debian] If Upgrading Apache 2.0 to 2.2 with SSL, Remove <IfDefine SSL>
DebianでApache 2.0を2.2へアップグレードするときは注意。特にSSLを使っているときは注意。らしい。

Debian GNU/Linux 4.0 ("etch") リリースノート (Intel x86 用)
- etchで知っておくべき問題点

http://www.debian.org/releases/etch/i386/release-notes/ch-information.ja.html#s-apache2

5.6 apache2のアップグレード

Apacheは新しいバージョン2.2にアップグレードしました。普通のユーザはこのアップグレードによる影響を受けませんが、知っておくべき、生じる可能性がある問題点がいくつかあります。

Debian特有の変更としては、デフォルトパッケージがsslをサポートするようになったため、SSLという文字列にもう意味がなくなった、などが挙げられます。

リリースノートは読んだけど意味が分からずに流していたら、思い切り影響を受けた。SSLっていうシンボル(?)が定義されないから、<IfDefine SSL>がfalseになるってことだったのね。

確かに
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz
からは、2.0のころにあったはずのがなくなっている。

/etc/apache2/sites-available/foo-ssl
で<IfDefine SSL>を使わないように編集して解決した。
  <IfDefine SSL>...</IfDefine>

の部分を、内容はそのままでタグを削除ないしコメントアウトするか、もしくは
  <IfModule mod_ssl.c>...</IfModule>

に置き換える。

削除する場合、無条件に設定が有効になるので、このサイト設定を使うときは忘れずにa2enmod sslしておくこと。

簡単に書いたけど、apache上のアプリケーションの設定も併せて半日潰れた。

---- 以下雑多なメモ

/etc/apache2/sites-available/foo-ssl
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz
にもある
  # When we also provide SSL we have to listen to the
  # standard HTTP port (see above) and to the HTTPS port

というコメントを見て/etc/apache2/ports.confを見直したけれど、結局これは関係なかった。これはHTTPに加えてHTTPS「も」提供する場合の話で、HTTPSしか提供しない場合はports.confには何も書く必要なし。SSLを使うサイトの設定にListen 443があればよい。

ブラウザでアクセスして
  example.org has sent an incorrect or unexpected error: code -12263

のようなエラーが返る場合は、SSLが働いていないことを疑う。

SSLの動作確認にはopensslが使えるらしい。
  % openssl s_client -connect example.org:443 -state -debug

として、
  SSL_connect:error in SSLv2/v3 read server hello A

と言われたら、HTTPSではなくHTTPをしゃべっている可能性あり。

---- 参考

Debian ETCHで、ApacheのSSLが有効にならない件
http://d.hatena.ne.jp/zxa/20070503/p1


----

その後リポジトリに小トラブル。
  [error] [client x.x.x.x] Provider encountered an error while streaming a REPORT response.  [500, #0]
  [error] [client x.x.x.x] A failure occurred while driving the update report editor  [500, #104]

とりあえず繰り返せばcheckoutできるので致命的じゃないんだけど、この先どうなるか心配。svnadmin verifyでは問題は見つからない。

あやしそうなのはこのへん。
http://subversion.tigris.org/faq.html#tiger-apr-0.9.6
Why do I get occasional, seemingly inconsistent errors when checking out over http:// from a repository running on MacOS X 10.4 (Tiger)?

Note: this assumes the repository is being served by Apache 2.0.x.

There is a bug in APR 0.9.6 that is present when it is running on Tiger, and shows up when you attempt to check out a file larger than 64Kb.

http://subversion.tigris.org/faq.html#ssl-negotiation-error
When performing Subversion operations involving a lot of data over SSL, I get the error SSL negotiation failed: SSL error: decryption failed or bad record mac.

This can occur due to a problem with OpenSSL 0.9.8. Downgrading to an older version (or possibly upgrading to a newer version) is known to fix this issue.

うーん。

ソフトウェアのバージョンが上がれば機能が増えてバグが減るっていう仮定は間違っているけど、なんだか負け気分。

Apacheは便利だけど、頼りきらずに別の方法も確保しておかないとまずいな。



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…