【问题标题】:Error "Forbidden" when .htaccess present?.htaccess 存在时出现“禁止”错误?
【发布时间】:2012-05-22 17:17:52
【问题描述】:

我正在使用 nginx 代理运行 Apache2 网络服务器,只要我在我的文件夹中放置一个 .htaccess,我就会得到 ​​p>

Forbidden

You don't have permission to access blabla on this server.

在我的 httpd.conf 中,我设置了 AllowOverride All

.htaccess 的内容无关紧要,只要文件存在,我就会收到 Forbidden 错误。

这里有什么问题?

【问题讨论】:

  • 查看服务器的错误日志,应该有更多的细节

标签: apache nginx apache2


【解决方案1】:

这绝对取决于您的 .htaccess 包含的内容。但是 HTTP/1.0 Forbidden 让我认为您要么拥有

  1. 没有DirectoryIndex 存在或者你覆盖它 - 并且还有Options -Indexes
  2. 你有一些符号链接,而你本地 htaccess 中的 Options +FollowSymlinks 把事情搞砸了

为了使正确的符号链接与 apache 一起工作,包含目录必须具有 apache 用户的执行权限。

来自我的 drupal /sites/ 文件夹的示例输出 ls -la

drwxr-xr-x 4 mschr root 4096 5 月 9 日 15:41。

drwxr-xr-x 9 mschr apache 4096 5 月 22 日 21:18 ..

lrwxrwxrwx 1 root root 16 4 May 08:16 all -> /etc/drupal/all/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-12
    • 2013-07-19
    • 1970-01-01
    • 2017-08-27
    相关资源
    最近更新 更多