三、检查方法介绍
Linux系统下可通过命令wget或curl,查看主机头信息,正常网站多为200、30X等错误,停止或禁止访问的多为40X错误。
1、正常网站(200)
[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)
[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.