テストサーバー(OS X 10.7サーバー)でSSL構成をテストするために使用している単純なRails 3.1.rc6アプリがあります。Phusion Passenger と Apache を使用しています。
SSL を使用しない場合、問題なくアプリを実行できます。Apache 経由またはファイル内経由config.force_ssl = true
でSSL を有効にするenvironments/production.rb
と、ページはエラーなしで読み込まれますが、ほとんど空で、自分のサイトではありません。空のディレクトリからファイルを提供しようとしているかのように見えます。
SSL の構成について Edge Rails のドキュメントを確認したconfig.force_ssl = true
ところ、Rack::SSL ミドルウェアが自動的に使用されるというオプションの追加についてのみ言及されています。
ページをロードすると、次のように表示されます。
Index of /
Name Last modified Size Description
Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.8 Server at mysite.mydomain.com Port 443
Rails アプリで ssl 構成行を削除し、サーバー ツールを使用してサイトを SSL に強制すると (テスト用に自己署名証明書を選択します)、まったく同じことが起こります。... myapp/current/public
持っているときのように、フォルダーを提供するには何を変更する必要がありますconfig.force_ssl = false
か?
編集:もう少し情報。に次のように表示され/var/log/apache2/error_log
ます。
[Fri Aug 26 10:57:49 2011] [notice] caught SIGTERM, shutting down
[Fri Aug 26 10:57:50 2011] [warn] RSA server certificate CommonName (CN) `My-Mac-mini.local' does NOT match server name!?
...
[Fri Aug 26 10:57:50 2011] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
httpd: Could not reliably determine the server's fully qualified domain name, using myserver.local for ServerName
[Fri Aug 26 10:57:50 2011] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
[Fri Aug 26 10:57:50 2011] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
[Fri Aug 26 10:57:50 2011] [warn] RSA server certificate CommonName (CN) `My-Mac-mini.local' does NOT match server name!?
...
[Fri Aug 26 10:57:50 2011] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Fri Aug 26 10:57:50 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.8 configured -- resuming normal operations
cache: [GET /] miss