[[PageOutline]] [[TitleIndex(TipAndDoc/network/httpd,format=group)]] = Name-based VirtualHost with SSL = * [http://kjirou.sakura.ne.jp/wiki_mirror/index.php?a%2FApache#q549090f 名前ベースのバーチャルホストで複数ドメインにSSLを割り当てることは可能か?] * 本質的な問題 {{{ HTTP プロトコルと SSL の原理を考えてみても不可能なことは明らかですね。 ネームベースのバーチャルホストは、HTTP リクエストヘッダに含まれる「Host」を参照 して アクセスするバーチャルホストを変化させますが、 SSL 接続の場合、HTTP リクエストヘッダは暗号化されており、 参照することができません。 参照するためには、暗号を解読してやればよいわけですが、 暗号を解読するためには先に証明書の交換を行う必要がありますね。 }}} * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#vhosts2 Why is it not possible to use Name-Based Virtual Hosting to identify different SSL virtual hosts?] * It is possible, but only if using a 2.2.12 or later web server, built with 0.9.8j or later OpenSSL. This is because it requires a feature that only the most recent revisions of the SSL specification added, called Server Name Indication (SNI). * The reason is that the SSL protocol is a separate layer which encapsulates the HTTP protocol. So the SSL session is a separate transaction, that takes place before the HTTP session has begun. The server receives an SSL request on IP address X and port Y (usually 443). Since the SSL request did not contain any Host: field, the server had no way to decide which SSL virtual host to use. Usually, it just used the first one it found which matched the port and IP address specified. * ただし、全てのVirtualHostで同じワイルドカード証明書を指定すれば可能 = mod_proxy = * SSLProxyEngine * リバースプロキシでSSL接続をする際に必要 {{{ [Tue Sep 21 02:05:25 2010] [error] proxy: HTTPS: failed to enable ssl support for 127.0.0.1:443 (localhost) }}} * [http://on-o.com/page/diary/20090804.html わんこ日記(2009-08-04)] * [http://d.hatena.ne.jp/bushimichi/20090417/1239970196 mod_proxy でバックエンドにSSLを利用する設定 - bushimichiの日記] = mod_rewrite = * [http://net-newbie.com/trans/mod_rewrite.html Apache module mod_rewrite] * 日本語訳 * [http://japache.infoscience.co.jp/rewriteguide/ Apache URL Rewriting Guide] * 日本語訳/例が多く載っている * [http://tm.root-n.com/server:apache:module:rewrite apache :: Rewrite(mod_rewrite) Tipsというかメモ] * 複数行に渡って記述する際の例 * [http://maihy.com/hp/phptech/phptech_url_rew.html URL 書き換え( mod_rewrite ):とことん!ホームページ] * [http://tech.bayashi.jp/archives/entry/techweb/2007/001981.html mod_rewrite サンプル集/楽] > Apache1.X 系で mod_rewrite を使う場合、URLに「%2F」が含まれると思い通りに動作しない問題があります。 > (Apache2.X 系でも同様ですが、Apache2.0.46 以降では「AllowEncodedSlashes On」により回避できます。) * [http://tech.bayashi.jp/archives/entry/techweb/2007/001995.html mod_rewriteでQUERY_STRINGをゴニョゴニョする/楽] > クエリーを残したままリダイレクトするには [QSA] オプションをつける。 * [http://blog.jojo.jp/?eid=1068256 BASIC認証にて、REMOTE_USERによりコンテンツを切替 | 作業日報]