在配置Linux的 Apache服务时,经常会遇到http403错误,我今天配置测试时也出现了,最后解决了,总结了一下。http 403错误是拒绝访问的意思,有很多原因的。我总结的主要有4种原因!
1. 访问的文档权限不够。要755以上权限。解决方法:用命令chmod 755 /var/www/ 或其他相应目录。
2. SELinux或防火墙的原因。解决方法:先关闭SELinux和让防火墙通过WWW服务。
3. 虚拟主机配置错误。解决方法:重新配置虚拟主机或暂时关闭。
4. alias指令配置错误。(alias语法:Alias URL-path file-path|directory-path)
解决方法如下: 打开apache的配置文件httpd.conf,查看所有的alias指令,若指令中的URL-path末尾包含/,则file-path或dir-path的末尾也需要包含/,如下所示:
alias /server1 /var/server1 //正确
alias /server1/ /var/server1/ //正确
alias /server1/ /var/server1 //错误
5. DocumentRoot的设置。解决方法如下:
打开 apache的配置文件httpd.conf,找到这段代码:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
有时候由于配置了php后,这里的“Deny from all”已经拒绝了一切连接。把该行改成“allow from all”,修改后的代码如下,问题解决。
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
6. For bugzilla installation
You should check the user in httpd.conf and localconfig, and make sure the same user in those two files:
6.1 For httpd.conf as below:
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon
6.2 For localconfig
# This is the group your web server runs as.
# If you have a Windows box, ignore this setting.
# If you do not have access to the group your web server runs under,
# set this to "". If you do set this to "", then your Bugzilla installation
# will be _VERY_ insecure, because some files will be world readable/writable,
# and so anyone who can get local access to your machine can do whatever they
# want. You should only have this set to "" if this is a testing installation
# and you cannot set this up any other way. YOU HAVE BEEN WARNED!
# If you set this to anything other than "", you will need to run checksetup.pl
# asroot, or as a user who is a member of the specified group.
$webservergroup = 'daemon';
6.3 Change the ownership by the chown command as below:
Chown -R root:daemon bugs/
分享到:
相关推荐
apache下403 Forbidden错误问题解决方法.docx
IIS发布mvc遇到的HTTP错误 403.14-Forbidden解决办法
主要介绍了Nginx 403 forbidden的解决办法,,需要的朋友可以参考下
Nginx服务器中403 forbidden的错误如何解决.docx
本篇文章主要介绍了详解Nginx 出现 403 Forbidden 的解决办法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
主要介绍了apache服务出现Forbidden 403问题的解决方法总结,需要的朋友可以参考下
给大家介绍了Nginx 出现 403 Forbidden 最终解决方法,下面分步骤给大家介绍的非常详细,感兴趣的的朋友一起看看吧
网页显示 403 Forbidden Nginx(yum 安装日志一般在/var/log/nginx/error.log) 错误日志显示 open() /web/www/one.txt failed (13: Permission denied), client: 192.168.1.110, server: rumenz.com, request: GET /...
最近因为工作需要,要将Nginx网站根目录更改下,通过网上的一些教程更改后,但发现测试的时候一直提示403 forbidden错误,后台通过一个朋友的提示也解决了,所以现在将详细的步骤分享给大家,有需要的朋友们可以参考...
主要介绍了Nginx报403 forbidden错误 (13: Permission denied)的解决办法,引起nginx 403 forbidden通常是三种情况:一是缺少索引文件,二是权限问题,三是SELinux状态。具体内容详情大家可以参考下本
本篇文章主要介绍了Spring Cloud出现Options Forbidden 403问题解决方法,具有一定的参考价值,有兴趣的可以了解一下
AETA-403禁止 这是403 Forbidden团队的资料库
主要介绍了nginx配置引发的403问题解决办法的相关资料,需要的朋友可以参考下
主要介绍了权限问题导致Nginx 403 Forbidden错误的解决方法,本文中导致 403 Forbidden错误的原因是配置文件中没有指明一个用户,需要的朋友可以参考下