【发布时间】:2018-06-20 19:14:36
【问题描述】:
我确定有人提出并回答了这个问题,但我没有找到解决方案。我有一个刚刚添加 SSL 的虚拟主机,但它没有按预期工作。非 SSL 版本工作正常。以下是我在 httpd.conf 中的内容:
<VirtualHost mysite.com:443>
ServerAdmin email@myemail.com
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/html/www.mysite.com
<Directory /var/www/html/www.mysite.com>
DirectoryIndex index.html index.htm index.php
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/my.crt
SSLCertificateKeyFile /etc/pki/tls/private/my.key
</VirtualHost>
我得到的错误是:
[Thu Jan 11 12:29:58.984354 2018] [autoindex:error] [pid 19998] [client
IP:38470] AH01276: Cannot serve directory /var/www/html/: No matching
DirectoryIndex (index.html,index.php) found, and server-generated directory
index forbidden by Options directive
显然,我将目录设置为 /var/www/html/www.mysite.com,但它试图直接从 /var/www/html 提供内容。
我确信这很简单,但我的大脑已经因为整天在这个网站上工作而变得麻木,所以我可能只是没能看到我面前的东西。
谢谢!
【问题讨论】:
-
显然错误信息是由另一个虚拟主机产生的。
-
不,我在下面解释了错误。