This question already has answers here:
Apache VirtualHost 403 Forbidden
(8个答案)
两年前关闭。
在
注:我在MAC OSX Sierra 10.12上
我下面的教程是here-按照说明,我运行了
需要注意的是,在使用以下命令运行
在httpd.conf文件中,我取消了以下行的注释(再次按照教程的指示):
我的
你知道我会做错什么吗?如果需要更多信息,请告诉我。
(8个答案)
两年前关闭。
在
DocumentRoot
上为我的httpd-vhosts
文件获取403错误注:我在MAC OSX Sierra 10.12上
我下面的教程是here-按照说明,我运行了
chmod 755 /sites/blog/my-website/web
,但它没有解决问题。我也以sudo
的身份跑步,但没有成功。需要注意的是,在使用以下命令运行
chmod
之后,我刷新了缓存并重新启动:sudo apachectl restart
dscacheutil -flushcache
在httpd.conf文件中,我取消了以下行的注释(再次按照教程的指示):
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
我的
httpd-vhosts.conf
配置如下:<VirtualHost *:80>
DocumentRoot "/sites"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/sites/blog/my-website/web"
ServerName mywebsite.dev
ErrorLog "/private/var/log/apache2/connor.local-error_log"
CustomLog "/private/var/log/apache2/connor.local-access_log" common
<Directory "/sites/blog/my-website/web">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
你知道我会做错什么吗?如果需要更多信息,请告诉我。
最佳答案
Apache VirtualHost 403 Forbidden
是什么解决了它。引用答案:
Apache2.4.3(或者稍早)添加了一个新的安全特性
这通常会导致这个错误。您还将看到
表单“客户端被服务器配置拒绝”。特点是
需要用户标识才能访问目录。它由打开
Apache附带的httpd.conf中的默认值。你可以看到
使用指令启用功能
我需要在Require all granted
中添加<Directory></Directory>
关于mysql - 禁止所有<Directory>上的Apache 403-virtualhosts ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45359646/