ゴリラ向け動画サイト「ウホウホ動画」にありがちなこと

CentOS6.3 / Apache2.2.15 でWEBサイトを構築しています。

URLと表示されるファイルの関係を以下の様にしたいと思っています。

(1)http://example.com/ → /var/www/html/index.html
(2)http://example.com/site → /var/www/html/site/public_html/index.html
(3)https://example.com/site → /var/www/html/site/secure_html/index.html

httpd.conf では、以下の様に記述しています。

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
 ServerName example.com
 DocumentRoot /var/www/html
 Alias /onsite /var/www/html/site/public_html
 <Directory "/var/www/html/site/public_html">
  DirectoryIndex index.html index.htm index.php index.cgi index.shtml
  AllowOverride All
  Options Includes FollowSymLinks MultiViews +ExecCGI
  Order allow,deny
  Allow from all
 </Directory>
</VirtualHost>

<VirtualHost *:443>
 ServerName example.com
 DocumentRoot /var/www/html
 Alias /onsite /var/www/html/site/secure_html
 <Directory "/var/www/html/site/secure_html">
  DirectoryIndex index.html index.htm index.php index.cgi index.shtml
  AllowOverride All
  Options Includes FollowSymLinks MultiViews +ExecCGI
  Order allow,deny
  Allow from all
 </Directory>
 SSLEngine on
 SSLProtocol all -SSLv2
 SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP:-eNULL
 SSLCertificateFile /etc/pki/tls/certs/server.crt
 SSLCertificateKeyFile /etc/pki/tls/certs/server.key
</VirtualHost>

現在(1)と(2)は実現できておりますが、(3)のURLにアクセスした際、/var/www/html/site/index.html を読みに行き、404となります。
<VirtualHost *:443>内ではAliasが効かないのでしょうか?

2日ほど検索してみましたが、これといった解決策を見つけることができませんでした。
ご意見・ご指摘をよろしくお願いいたします。

質問者からの補足コメント

  • lowrider_2005様のご指摘のように、*からIPアドレスへ変更した結果、うまく動作するようになりました。
    今回はこちらの方法で設定したいと思いますが、なぜIPアドレス指定じゃないと動かないのか…
    とりあえずBAとさせていただきました!

      補足日時:2017/01/30 11:31

A 回答 (1件)

><VirtualHost *:443>内ではAliasが効かないのでしょうか?



うちはapache2.2.31ですが、使えてますよ。
(VirtualHostは「*」ではなくIPアドレスを入れていますが)
エラーログを見てみたらいがでしょうか。

余計なことですが、SSLv3もdisableしておいたほうが良いかもしれません。
    • good
    • 0
この回答へのお礼

ご回答ありがとうございます。
ssl_error_logにはオレオレ証明書に関する警告と、404エラーのみ記載されておりました。
error_logには特に記載はありませんでした。

お礼日時:2017/01/27 10:49

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!