当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > apache 403错误 Forbidden解决方法

Unix/Linux
Fedora Core 5(FC-5)正式版下载
Fedora 7.0 中文输入法
Fedora Core 8中yum设置
官方发布 Fedora 9 Re-Spin
防止SSH暴力破解密码的方法(DenyHosts)
让Fedora6 支持超过4G的内存
Fedora 9官方最终版下载
重装Windows系统,修复Fedora Linux启动
Fedora linux启动时网卡eth0激活慢
Fedora 9.0 Apache+PHP+MYSQL 环境安装
Fedora 4升级到Fedora 9
Linux x86_64下安装Flash Player 9
Fedora 9.0下触摸板不能点击的解决方案
fedora 系统下grub修复
Fedora 9 texlive + vim-latex + kile安装配置
运行fedora 9下的3D特效
装完Fedora 9后系统的简单设置
Fedora系统下检测声卡的命令
Fedora 9 系统下ALSA声卡驱动下载及安装方法
Fedora环境下快速建立chroot环境的方法

Unix/Linux 中的 apache 403错误 Forbidden解决方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 194 ::
收藏到网摘: n/a

 

关键错误:You don't have permission to access / on this server
打开网页,结果访问提示:403错误!关闭了IE的"显示友好的HTTP错误",显示没有权限访问(You don't have permission to access / on this server)!
我想着大概是没有权限去访问该目录,因为一般情况下,NTFS对访问权限控制的很严格的!
于是打开目录,一看,访问权限居然是everyone的完全控制!那用户在文件夹访问权限上是绝对没有问题了!肯定是apache的配置问题了,于是上网搜索,找到如下相关信息用于修改权限.

                                      
以下为引用的内容:
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
                    Order deny,allow
                  Deny from all
                    Satisfy all
            </Directory>

根据配置文件提示,此设置是用于修改Apache对所有目录的访问权限的,如果任意修改,可能会带来安全隐患的!那我们来看看到底是什么在作祟,让我们无法访问网页的吧!
Deny from all      有点英文基础的都可以看的出来,这里是关键:拒绝所有!
将Deny改为Allow试试!(因为可能会存在大小写敏感的问题,所以推荐用首字母大写,有兴趣的可以自己尝试小写!)一下通过了,但是这样配置的话服务器安全性会...
于是我继续往下看配置文件!


发现了以下内容
#
# This should be changed to whatever you set DocumentRoot to.
#
以上这行注释的意思:无论你的服务器根目录设置为什么,你都必须保证此处配置保持一致!

                                      
以下为引用的内容:
            <Directory "默认目录">
                    #
                    # Possible values for the Options directive are "None", "All",
                    # or any combination of:
                    #      Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
                    #
                    # Note that "MultiViews" must be named *explicitly* --- "Options All"
                    # doesn't give it to you.
                    #
                    # The Options directive is both complicated and important.      Please see
                    # http://httpd.apache.org/docs/2.2/mod/core.html#options
                    # for more information.
                    #
                    Options Indexes FollowSymLinks             

        #
                    # AllowOverride controls what directives may be placed in .htaccess files.
                    # It can be "All", "None", or any combination of the keywords:
                    #      Options FileInfo AuthConfig Limit
                    #
                    AllowOverride None

            

        #
                    # Controls who can get stuff from this server.
                    #
                    Order allow,deny
                    Allow from all

            

</Directory>

            

再将以上的"默认目录"设置为"目标目录",(当然已经将对所有权限访问的设置修改为拒绝了!)刷新一下页面,OK,通过了!