国外代理服务器ip遇到403错误怎么解决

 2023-12-22  阅读 2  评论 0

摘要:国外代理主机ip遇到403错误如何解决 海外代理主机ip遇到403毛病的解决方法:1、输入cmd打开命令行后,输入ipconfig /flushdns,同时查看是不是是有在网站虚拟目录中添加默许文档;2、输入命令chcon -R -t httpd_user_content_t public_html/修改文件夹安全属性;3、如是apac

国外代理服务器ip遇到403错误怎么解决

国外代理主机ip遇到403错误如何解决

海外代理主机ip遇到403毛病的解决方法:1、输入cmd打开命令行后,输入ipconfig /flushdns,同时查看是不是是有在网站虚拟目录中添加默许文档;2、输入命令chcon -R -t httpd_user_content_t public_html/修改文件夹安全属性;3、如是apache致使的403 forbidden毛病,则在apache的配置文件httpd.conf中把Deny from all改成allow from all。

下面是详细介绍:

1、重建dns缓存

对一些常规的403 forbidden毛病,建议大家首先要尝试的就是重建dns缓存,在运行中输入cmd,然后输入ipconfig /flushdns便可。如果不行的话,就需要在hosts文件里把主页解析一下了。

同时,查看是不是是在网站虚拟目录中添加默许文档,一般默许文档为:index.html;index.asp;index.php;index.jsp;default.htm;default.asp等

2、修改文件夹安全属性

用以下命令修改文件夹安全属性

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

3、关于apache致使的403 forbidden毛病的解决办法

打开apache的配置文件httpd.conf,找到这段代码:

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

有时候由于配置了php后,这里的“Deny from all”已谢绝了一切连接。把该行改成“allow from all”,修改后的代码以下,问题解决。

Options FollowSymLinks

AllowOverride None

Order deny,allow

Allow from all

之所以会出现毛病,是由于大多数的国外主机在配置Apache的时候启用了mod_security,也就是开启了安全检查,如果提交的信息中包括select , % , bin等关键字,Apache就会制止,并给出403,404,500等毛病。

版权声明:xxxxxxxxx;

原文链接:https://lecms.nxtedu.cn/yunzhuji/101735.html

发表评论:

验证码

管理员

  • 内容1196554
  • 积分0
  • 金币0
关于我们
lecms主程序为免费提供使用,使用者不得将本系统应用于任何形式的非法用途,由此产生的一切法律风险,需由使用者自行承担,与本站和开发者无关。一旦使用lecms,表示您即承认您已阅读、理解并同意受此条款的约束,并遵守所有相应法律和法规。
联系方式
电话:
地址:广东省中山市
Email:admin@qq.com
注册登录
注册帐号
登录帐号

Copyright © 2022 LECMS Inc. 保留所有权利。 Powered by LECMS 3.0.3

页面耗时0.0123秒, 内存占用335.04 KB, 访问数据库18次