您好,我在通过浏览器访问我的实时网站时遇到 403 错误。昨天工作正常。我不确定为什么会出现此错误。我已经搜索了很多。这些是我尝试过的解决方案:
我已将我的 httpd.conf 文件的配置从默认更改为:
<Directory /> #Options FollowSymLinks Options Indexes FollowSymLinks Includes AllowOverride All Order deny,allow Allow from all </Directory>
更改了
/var/www/html
的权限目录从默认到777
还有一些东西。但没有任何效果。我不确定出了什么问题。
我的服务器配置是:
Apache /2.2.29。 AWS EC2 实例。
这是浏览器上显示的错误信息:
禁止
You don't have permission to access / on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
这是来自 error_logs
的错误消息:
[Thu May 21 14:58:51 2015] [error] [client XXX.XXX.XXX.XXX] Directory index forbidden by Options directive: /var/www/
[Thu May 21 14:58:51 2015] [error] [client XXX.XXX.XXX.XXX] File does not exist: /var/www/error/noindex.html
如果您需要其他任何东西,请在评论中告诉我。提前致谢:)
最佳答案
我正在尝试为 Apache/2.2.29 设置虚拟主机。 AWS EC2 实例。 遇到同样的错误。 我通过查看 error.log 来解决它
我需要给父文件夹755
在您的错误日志中“文件不存在:/var/www/error/noindex.html” 意味着你需要有这个文件夹和文件。
我用的是chmod 755 -R/var/www/
关于linux - 通过浏览器访问站点时出现 403(Access Forbidden) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30378534/