【发布时间】:2017-06-27 21:47:52
【问题描述】:
当我尝试访问父目录时,比如 localhost/parent,它给了我 403 禁止。但是,如果我访问子目录,比如 localhost/parent/index.html,它就会通过。 我相信这是一个配置问题,但有人可以在这里指导我吗? 我尝试按照很多人的建议更改 apache2.conf,但它不起作用。(如下所示)
<Directory "your directory here">
Order allow,deny
Allow from all
Require all granted
</Directory>
以下是错误日志的内容:
[Mon Jul 03 11:32:51.028149 2017] [autoindex:error] [pid 4899] [client 127.0.0.1:42462] AH01276: Cannot serve directory /var/www/html/hub/: No matching DirectoryIndex (index.php,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
【问题讨论】:
-
错误日志说明了什么?它可能是底层权限,而不是 Apache 配置。
-
您希望在 /hub/ 中看到什么?目录列表?一些特定的文件?
-
不,我希望它在集线器中加载 index.html 文件。