差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| linux:httpd:virtualhost_sni_redirect [2019/05/18 02:23] – 外部編集 非ログインユーザー | linux:httpd:virtualhost_sni_redirect [2023/06/01 05:55] (現在) – [Apache 全体の SSL の設定] ともやん | ||
|---|---|---|---|
| 行 8: | 行 8: | ||
| * 複数の SSL 証明書を取得済みである事 | * 複数の SSL 証明書を取得済みである事 | ||
| + | <WRAP prewrap 100% #mintbl> | ||
| ^ ユーザーアクセスパターン | ^ ユーザーアクセスパターン | ||
| | http:// | | http:// | ||
| 行 16: | 行 17: | ||
| | https:// | | https:// | ||
| | http:// | | http:// | ||
| + | </ | ||
| - | ===== 最初の設定内容(問題の発生する設定) ===== | + | ===== 最終的な設定内容(問題の発生しない設定) ===== |
| - | 結論から言うと以下の設定方法では問題が発生しました。\\ | + | Apache は Rewrite より Redirect |
| - | なぜか https:// | + | Rewrite するだけの処理であったとしても |
| ==== Apache 全体の SSL の設定 ==== | ==== Apache 全体の SSL の設定 ==== | ||
| - | <code> | + | < |
| - | $ sudo vi /etc/httpd/conf.d/ssl.conf | + | $ sudo vi / |
| - | </code> | + | </ |
| - | <file autoconf /etc/httpd/conf.d/ssl.conf> | + | <file autoconf / |
| # SNIに未対応のブラウザ用の設定 | # SNIに未対応のブラウザ用の設定 | ||
| SSLStrictSNIVHostCheck off | SSLStrictSNIVHostCheck off | ||
| - | </file> | + | </ |
| - | ==== monsters-g.com SSL の設定(問題の発生する設定) | + | ==== monsters-g.com SSL の設定 ==== |
| + | Apache のバーチャルホストの設定。\\ | ||
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| + | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| - | < | ||
| - | ServerName monsters-g.com | ||
| - | RewriteEngine on | ||
| - | RewriteCond %{HTTP_HOST} ^monsters-g\.com | ||
| - | RewriteRule ^/(.*)$ https:// | ||
| - | </ | ||
| < | < | ||
| ServerName www.monsters-g.com | ServerName www.monsters-g.com | ||
| - | | + | |
| - | RewriteCond %{HTTP_HOST} ^www\.monsters-g\.com | + | |
| - | | + | |
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName www.monsters-g.com | ServerName www.monsters-g.com | ||
| + | ServerAlias monsters-g.com | ||
| + | |||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP_HOST} ^monsters-g\.com | ||
| + | RewriteRule ^/(.*)$ https:// | ||
| + | |||
| + | SSLEngine on | ||
| + | SSLProtocol all -SSLv2 -SSLv3 | ||
| + | SSLCipherSuite !3DES: | ||
| + | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 61: | 行 68: | ||
| </ | </ | ||
| </ | </ | ||
| + | </ | ||
| - | ==== tomoyan.net SSL の設定(問題の発生する設定) | + | ==== tomoyan.net SSL の設定 ==== |
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| + | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| - | < | ||
| - | ServerName tomoyan.net | ||
| - | RewriteEngine on | ||
| - | RewriteCond %{HTTP_HOST} ^tomoyan\.net | ||
| - | RewriteRule ^/(.*)$ https:// | ||
| - | </ | ||
| < | < | ||
| ServerName www.tomoyan.net | ServerName www.tomoyan.net | ||
| - | | + | |
| - | RewriteCond %{HTTP_HOST} ^www\.tomoyan\.net | + | |
| - | | + | |
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName www.tomoyan.net | ServerName www.tomoyan.net | ||
| + | ServerAlias tomoyan.net | ||
| + | |||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP_HOST} ^tomoyan\.net | ||
| + | RewriteRule ^/(.*)$ https:// | ||
| + | |||
| + | SSLEngine on | ||
| + | SSLProtocol all -SSLv2 -SSLv3 | ||
| + | SSLCipherSuite !3DES: | ||
| + | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 93: | 行 105: | ||
| </ | </ | ||
| </ | </ | ||
| + | </ | ||
| - | ==== repos.tomoyan.net SSL の設定(問題の発生する設定) | + | ==== repos.tomoyan.net SSL の設定 ==== |
| + | Apache のバーチャルホストの設定。\\ | ||
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| + | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| < | < | ||
| ServerName repos.tomoyan.net | ServerName repos.tomoyan.net | ||
| - | | + | |
| - | RewriteCond %{HTTP_HOST} ^repos\.tomoyan\.net | + | |
| - | RewriteRule ^/(.*)$ https:// | + | |
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName repos.tomoyan.net | ServerName repos.tomoyan.net | ||
| + | |||
| + | SSLEngine on | ||
| + | SSLProtocol all -SSLv2 -SSLv3 | ||
| + | SSLCipherSuite !3DES: | ||
| + | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 119: | 行 137: | ||
| </ | </ | ||
| </ | </ | ||
| + | </ | ||
| - | ===== 最終的な設定内容(問題の発生しない設定) ===== | + | ===== 最初の設定内容(問題の発生する設定) ===== |
| - | Apache は Rewrite より Redirect | + | 結論から言うと以下の設定方法では問題が発生しました。\\ |
| - | Rewrite するだけの処理であったとしても | + | なぜか https:// |
| ==== Apache 全体の SSL の設定 ==== | ==== Apache 全体の SSL の設定 ==== | ||
| 行 133: | 行 152: | ||
| </ | </ | ||
| - | ==== monsters-g.com SSL の設定 ==== | + | ==== monsters-g.com SSL の設定(問題の発生する設定) |
| - | Apache のバーチャルホストの設定。\\ | + | |
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| - | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| + | < | ||
| + | ServerName monsters-g.com | ||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP_HOST} ^monsters-g\.com | ||
| + | RewriteRule ^/(.*)$ https:// | ||
| + | </ | ||
| < | < | ||
| ServerName www.monsters-g.com | ServerName www.monsters-g.com | ||
| - | | + | |
| - | | + | RewriteCond %{HTTP_HOST} ^www\.monsters-g\.com |
| + | | ||
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName www.monsters-g.com | ServerName www.monsters-g.com | ||
| - | ServerAlias monsters-g.com | ||
| - | |||
| - | RewriteEngine on | ||
| - | RewriteCond %{HTTP_HOST} ^monsters-g\.com | ||
| - | RewriteRule ^/(.*)$ https:// | ||
| - | |||
| - | SSLEngine on | ||
| - | SSLProtocol all -SSLv2 -SSLv3 | ||
| - | SSLCipherSuite !3DES: | ||
| - | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 169: | 行 183: | ||
| </ | </ | ||
| </ | </ | ||
| - | </ | ||
| - | ==== tomoyan.net SSL の設定 ==== | + | ==== tomoyan.net SSL の設定(問題の発生する設定) |
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| - | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| + | < | ||
| + | ServerName tomoyan.net | ||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP_HOST} ^tomoyan\.net | ||
| + | RewriteRule ^/(.*)$ https:// | ||
| + | </ | ||
| < | < | ||
| ServerName www.tomoyan.net | ServerName www.tomoyan.net | ||
| - | | + | |
| - | | + | RewriteCond %{HTTP_HOST} ^www\.tomoyan\.net |
| + | | ||
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName www.tomoyan.net | ServerName www.tomoyan.net | ||
| - | ServerAlias tomoyan.net | ||
| - | |||
| - | RewriteEngine on | ||
| - | RewriteCond %{HTTP_HOST} ^tomoyan\.net | ||
| - | RewriteRule ^/(.*)$ https:// | ||
| - | |||
| - | SSLEngine on | ||
| - | SSLProtocol all -SSLv2 -SSLv3 | ||
| - | SSLCipherSuite !3DES: | ||
| - | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 206: | 行 215: | ||
| </ | </ | ||
| </ | </ | ||
| - | </ | ||
| - | ==== repos.tomoyan.net SSL の設定 ==== | + | ==== repos.tomoyan.net SSL の設定(問題の発生する設定) |
| - | Apache のバーチャルホストの設定。\\ | + | |
| < | < | ||
| $ sudo vi / | $ sudo vi / | ||
| </ | </ | ||
| - | <WRAP prewrap 100%> | ||
| <file autoconf / | <file autoconf / | ||
| < | < | ||
| ServerName repos.tomoyan.net | ServerName repos.tomoyan.net | ||
| - | | + | |
| + | RewriteCond %{HTTP_HOST} ^repos\.tomoyan\.net | ||
| + | RewriteRule ^/(.*)$ https:// | ||
| </ | </ | ||
| < | < | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| ServerName repos.tomoyan.net | ServerName repos.tomoyan.net | ||
| - | |||
| - | SSLEngine on | ||
| - | SSLProtocol all -SSLv2 -SSLv3 | ||
| - | SSLCipherSuite !3DES: | ||
| - | SSLHonorCipherOrder on | ||
| SSLCertificateFile / | SSLCertificateFile / | ||
| SSLCertificateKeyFile / | SSLCertificateKeyFile / | ||
| 行 238: | 行 241: | ||
| </ | </ | ||
| </ | </ | ||
| - | </ | ||
| ===== 参考文献 ===== | ===== 参考文献 ===== | ||