网站出现403 Forbidden

来源:互联网 发布:php接口interface 编辑:程序博客网 时间:2024/05/17 08:07

     1, 你在一定时间内过多地访问此网站(一般是用采集程序),被防火墙拒绝访问了

   

   2, 网站域名解析到了空间,但空间未绑定此域名


 3, 你的网页脚本文件在当前目录下没有执行权限



4, 服务器繁忙,同一IP地址发送请求过多,遭到服务器智能屏蔽


一般就以上几个原因,解决的方法其实也很简单:

重建dns缓存就行(可以换个浏览器试试,不一定非要执行这下面一步!)
在运行中输入cmd,然后输入ipconfig /flushdns即可 


或者是 

用以下命令修改文件夹安全属性 
chcon -R -t httpd_user_content_t public_html/ 

所用命令解析:
ls -Z -d public_html/
    #显示文件/目录的安全语境-Z, --context 
           Display  security context so it fits on most displays.  Displays only mode, user, group, security              context and file name.-d, --directory
            list directory entries instead of contents, and do not dereference symbolic links

chcon -R -t httpd_user_content_t public_html/
     #修改文件/目录的安全语境-R, --recursive
            change files and directories recursively-t, --type
            set type TYPE in the target security context
第一个方法解决了我的问题,第二个方法我是从网上看到的,应该也可以!大家可以去验证一下!如果有什么问题,别忘了交流!

0 0
原创粉丝点击