无法提供目录 /var/www/html/:没有匹配的 DirectoryIndex

Jam*_*mes 2 apache ssl http

我确信这个问题已经被提出并得到回答,但我没有找到解决方案。我有一个虚拟主机,刚刚添加了 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>
Run Code Online (Sandbox Code Playgroud)

我收到的错误是:

[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
Run Code Online (Sandbox Code Playgroud)

显然,我已将目录设置为 /var/www/html/www.mysite.com,但它试图直接从 /var/www/html 提供内容。

我确信这很简单,但我的大脑已经因为整天在这个网站上工作而变得糊涂了,所以我可能只是看不到我面前的东西。

谢谢!

Jam*_*mes 5

修复。正如我所假设的,很简单。改变:

<VirtualHost mysite.com:443>
Run Code Online (Sandbox Code Playgroud)

到:

<VirtualHost *:443>
Run Code Online (Sandbox Code Playgroud)