Debian Jessie 中的 Apache - 仍然收到消息您无权访问/在此服务器上

标签 apache debian

与 apache wheezy 相同的虚拟配置工作正常。 例如:

服务器名称 lgbs 服务器别名 www.lgbs

DocumentRoot /home/vdomain/app/web
SetEnv APPLICATION_ENV "development"

<Directory /home/vdomain/app/web>
    # enable the .htaccess rewrites
    AllowOverride All
    Order allow,deny
    Allow from All
</Directory>

但是在 Debian 测试“Jessie”时我仍然收到消息:

Forbidden 您无权访问此服务器上的/。 Apache/2.4.9 (Debian) 服务器在测试端口 80

当然,检查文件权限,我为 evryones 和所有者和组设置 rwx 是 www-data。 感谢帮助

最佳答案

这让我疯狂了几个小时。显然在 2.4.9(我从 2.2.2 升级而来)中有一个“要求全部授予”,您需要将其添加到每个目录。

在我的 http.conf 中:

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    Require all denied
</Directory>

所以基本上我必须做的是:

<Directory "/Users/johndoe/Sites">
    Require all granted
</Directory>

关于Debian Jessie 中的 Apache - 仍然收到消息您无权访问/在此服务器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22905936/

相关文章:

regex - 如何猜测完整的文件名,只有前 2 个字母

php - Forbidden 您无权访问/在此服务器上。服务器无法读取 htaccess 文件,为了安全拒绝访问

java - 创建 Restful 客户端后在 Maven 中出现异常

debian - rabbitmqadmin [Errno 111] 连接被拒绝

node.js - 在树莓派 2 上安装 node.js

python-3.x - 在 debian 11 Bullseye 上使用 Ansible 安装损坏的软件包

ruby - 如何通过 VPN 在服务器上安装 Ruby?

python - RuntimeError at/无法缓存函数 '__shear_dense' : no locator available for file '/home/...site-packages/librosa/util/utils.py'

MySQL 复制 - Slave 不会启动 mysql 服务

linux - 无法为 debian wheezy 正确安装 "sshfs-dbg"(7)