恶意指向解决方法,未备案网站恶意指向服务器后的解决方法

迅恒数据中心

一、恶意指向
目前存在一些用户将自己的域名解析指向他人的服务器,而那台服务器上事实并没有相应的站点,这种情况称之为恶意指向。但可能在服务器上设置了空主机头,访问这个域名时会直接访问指向了这个空主机头的站点内容,严重影响客户的备案工作。
为防止有效的恶意指向,对常见两种WEB服务器进行简单设置。
二、常见WEB服务器的解决方法
主要是绑定所有站点,禁用空主机头或默认站点,只能基于域名的访问方式,不使用基于IP,下面介绍IIS与APACHE的设置方法。
1、IIS的设置方法
IIS默认中,将任何站点都绑定到固定的域名,不可以留空主机头,这样没有绑定主机头的域名恶意指到此IP,默认会提示400错误,参考下图:
001.jpg

002.jpg

003.jpg

2、Apache 的设置方法
Apache可以通过禁用第一个虚拟站点。
打开apache的配置文件,通常是httpd.conf文件,使用基于域名的访问方式。必须有下面的指令,Apache的第一个虚拟站点即为默认站点,必须对此站点进行限制。

NameVirtualHost *

设置第一个虚拟站点,设置一个禁止访问的站点,apache则会提示403的禁止访问的错误:
 

 

<VirtualHost *>
ServerName www.firstdisabledsite.com
DocumentRoot /www/domain
</VirtualHost>

下面可以设置其它有效站点了:

[root@hostname ~]#wget -S http://www.sina.com.cn 或 curl -I http://www.sina.com.cn
--14:34:32-- http://www.sina.com.cn/
=> `index.html.1'
Resolving www.sina.com.cn... 61.172.201.194
Connecting to www.sina.com.cn|61.172.201.194|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
Date: Wed, 09 Dec 2009 06:30:15 GMT
Server: Apache/2.0.54 (Unix)
Last-Modified: Wed, 09 Dec 2009 06:29:44 GMT
……

2、跳转的网站(301),如果做301也属于网站能打开:

[root@hostname ~]# wget -S http://www.abc.com或 curl -I http:// http://www.abc.com
--14:36:36-- http://www.abc.com/
=> `index.html.2'
Resolving www.abc.com... 199.181.132.250
Connecting to www.abc.com|199.181.132.250|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Date: Wed, 09 Dec 2009 06:54:25 GMT
Server: Apache
Location: http://abc.go.com/
Content-Length: 226
Connection: Keep-Alive

3、停止的网站(404):
 

[root@hostname ~]# wget -S http://sample.srt.cn
--14:38:14-- http://sample.srt.cn/
=> `index.html'
Resolving sample.srt.cn... 192.168.0.1
Connecting to sample.srt.cn|192.168.0.1|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Wed, 09 Dec 2009 06:36:34 GMT
Connection: close
Content-Length: 39
14:38:14 ERROR 400: Bad Request


 

4、apache下禁止访问的站点(403):

[root@hostname ~]# wget -S http://sample1.srt.com.cn
--14:44:29-- http://sample1.srt.com.cn/
=> `index.html'
Resolving sample1.srt.com.cn... 1.2.3.234
Connecting to sample1.srt.com.cn|1.2.3.234|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 403 Forbidden
Date: Wed, 09 Dec 2009 06:43:42 GMT
Server: Apache/2.2.3 (Red Hat)
Content-Length: 405
Connection: close
Content-Type: text/html; charset=iso-8859-1
14:44:29 ERROR 403: Forbidden.

分类:教程帮助 百度收录 必应收录