パスワードを忘れた? アカウント作成
65689 journal

tokenの日記: SSLの設定・・・

日記 by token

http://freebsd.fkimura.com/cacert-a0.htmlを見ながら、自宅サーバにCACertでもらったサーバ証明書をセットアップしようとしてるんだけど、なぜか結果はいつも

[Mon Dec 22 01:47:07 2008] [error] Illegal attempt to re-initialise SSL for server (theoretically shouldn't happen!)

になってしまって、apacheが起動できなくなる。。

1度めで出てきたから、2回目にトライしてみたけど、やっぱりだめ。ん、このエラーメッセージの原因は一体どこにあるのか、探してみないとな。

追記メモ:2008-12-22,03:38

I'm running a system that includes virtual servers which makes the setup a tiny bit more complex. Following the instructions above I get the following error message (in /var/log/apache/error.log) when I try to start the server.

[error] mod_ssl: Init: (www.xfly.co.uk:80) Illegal attempt to re-initialise SSL for server (theoretically shouldn't happen!)

This is fixed by including the lines that activate the SSL Engine in a virtual host declaration rather than in the main server definition. I think it has something to do with the way mod-ssl is compiled but don't quote me on that. Anyway an example virtual host declaration is show below (with a modified email address):

        ServerAdmin webmaster@example.com
        DocumentRoot /somewhere/crazysquirrel.com
        ServerName www.crazysquirrel.com
        ErrorLog /var/log/apache/error.log
        CustomLog /var/log/apache/crazysquirrel.log combined

        SSLEngine on
        SSLCertificateFile /etc/apache/ssl.crt/www.crazysquirrel.com.crt
        SSLCertificateKeyFile /etc/apache/ssl.key/www.crazysquirrel.com.key
        SSLLog /var/log/apache/crazysquirrel_ssl.log
        SSLLogLevel warn

The other problem you may encounter is not having Apache bind port 443. In your server configuration file (httpd.conf) you need to enter the lines:

Listen 80
Listen 443

If you enter only the second line Apache won't bind port 80 and your non-ssl websites will stop working.

  via http://www.crazysquirrel.com/computing/debian/apache-mod_ssl.jspx

追記:2009-02-27,03:05
オレオレ証明局を試してみた結果、

Apache2のインストール
$ sudo apt-get install apache2 apache2-doc

デフォルトではSSLを使えるようにはなっていません。自分で設定するのか・・・。
SSL設定ファイルのコピー
$ sudo cp /usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz /etc/apache2/sites-available/
$ cd /etc/apache2/sites-available/
$ sudo gunzip httpd-ssl.conf.gz
--
via http://hirotyanteikoku.cocolog-nifty.com/cocolog/2008/10/ubuntuwebdav-3f.html

この辺りを試してみたら、エラーメッセージは消えました。設定ファイルのどこが悪かったのかは良くわかりませんが、サンプルファイルは使ってみるべきですね。(勿論、サンプルなのでdocument rootや、server nameはexample.comになってますから注意)

また、サンプルファイルの中に書かれていたBrowserMatchとかはコメントアウトしてしまいました。MSIEとか書かれてたようだから、不要かなぁと。

追記:2009-02-27,04:17
http://freebsd.fkimura.com/cacert-a0.htmlを見ながら、Ca-Cert.orgの証明書を使ったSSL接続も、出来た。

全ての問題は、apache2の設定ファイルの書き方だったようだ・・・orz 多分これなら、通常の証明局を使っても、問題なくSSL接続が出来るだろうなあ。

この議論は賞味期限が切れたので、アーカイブ化されています。 新たにコメントを付けることはできません。
typodupeerror

アレゲは一日にしてならず -- アレゲ研究家

読み込み中...