Apache in Debian Jessie - still get message You don't have permission to access / on this server

那年仲夏 提交于 2019-12-10 10:04:08

问题


The same virtual config i apache wheezy works right. For example:

ServerName lgbs ServerAlias 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>

But on Debian testing 'Jessie' i still get message:

Forbidden You don't have permission to access / on this server. Apache/2.4.9 (Debian) Server at test Port 80

Of course a check file permision and i set rwx for evryones and owner and group is www-data. Thanks for help


回答1:


This drove me crazy for a couple of hours. Apparently in 2.4.9 ( I upgraded from 2.2.2 ) there is a "Require all granted" that you need to add to each directory.

In my 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>

So basically what I had to do was:

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


来源:https://stackoverflow.com/questions/22905936/apache-in-debian-jessie-still-get-message-you-dont-have-permission-to-access

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!