【问题标题】:Apache 403 Directory index forbidden by Options directive, even with index.htmlOptions 指令禁止的 Apache 403 目录索引,即使使用 index.html
【发布时间】:2014-06-12 08:58:18
【问题描述】:

在尝试访问我们服务器上的某个目录时,我们收到以下 403 错误:

# /var/log/httpd/error_log
Directory index forbidden by Options directive: <path-to-directory>

这是用于目录的配置文件(包含在httpd.conf 中)。

# /etc/httpd/conf.d/<name-of-app>.conf
<VirtualHost *:80>
  DocumentRoot "<path-to-directory>"
  ServerName <server-name>

 <Directory "<path-to-directory>">
   Options +Indexes
   Order allow,deny
   Allow from all
   Require all granted
 </Directory>

</VirtualHost>

相关目录包含一个 index.html 文件。

我们将非常感谢提供任何帮助。

【问题讨论】:

  • 服务器配置中该目录是否还有其他定义?您是否启用了NameVirtualHost
  • 原来我需要添加DirectoryIndex index.html,这样就解决了问题。

标签: apache centos http-status-code-403


【解决方案1】:

我通过在目录中添加DirectoryIndex index.html 解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-28
    • 1970-01-01
    • 2011-07-15
    • 2021-06-14
    • 1970-01-01
    • 2018-10-16
    • 2016-06-19
    相关资源
    最近更新 更多