http错误日志的Hostname解决方法

将一个站点移到新服务器后,新服务器上出现了很多http错误日志(C:\WINDOWS\system32\LogFiles\HTTPERR),内容如下:

引用内容 引用内容
#Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri sc-status s-siteid s-reason s-queuename
2011-04-03 02:48:16 212.151.224.216 26798 61.191.61.146 80 HTTP/1.1 GET /portal/m/c5/3.ashx?r=1 400 - Hostname -
2011-04-03 02:48:17 202.91.18.201 1450 61.191.61.146 80 HTTP/1.1 GET /portal/m/c5/3.ashx?r=1 400 - Hostname -
2011-04-03 02:48:17 202.91.18.201 19704 61.191.61.146 80 HTTP/1.1 GET /portal/m/c5/3.ashx?r=1 400 - Hostname -
2011-04-03 02:48:17 202.91.18.201 56909 61.191.61.146 80 HTTP/1.1 GET /portal/m/c5/3.ashx?r=1 400 - Hostname -
2011-04-03 02:48:18 212.151.224.216 14377 61.191.61.146 80 HTTP/1.1 GET /portal/m/c5/3.ashx?r=1 400 - Hostname -

Hostname表示处理 Hostname 分析出错,之前解决过类似的问题,当时是站点有多个域名,系统重装后有几个域名没有加到站点主机头中,这次估计也是同样的原因。那是哪个域名没有添加呢?已经不能从旧服务器上查找,而httperr又没有记录是访问哪个域名出错,如果能让httperr把域名记下来问题就解决了,但百度了很久都没找到设置的地方。

打电话给一个做服务器管理的同事,他提出了一个解决方法:IIS站点日志是可以设置记录访问域名的,在IIS上建立一个空主机头的站点,到时看下站点日志就能查出是哪个域名的问题。

设置站点日志记录域名:



站点日志:

引用内容 引用内容
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs-host sc-status sc-substatus sc-win32-status
2011-04-03 02:51:10 W3SVC1 61.191.61.146 GET /portal/m/c5/3.ashx r=1 80 - 212.151.224.216 myhttpClient+1.0 datacenter.mzwu.com 404 0 3
2011-04-03 02:51:11 W3SVC1 61.191.61.146 GET /portal/m/c5/3.ashx r=1 80 - 202.91.18.201 myhttpClient+1.0 datacenter.mzwu.com 404 0 3
2011-04-03 02:51:11 W3SVC1 61.191.61.146 GET /portal/m/c5/3.ashx r=1 80 - 202.91.18.201 myhttpClient+1.0 datacenter.mzwu.com 404 0 3
2011-04-03 02:51:12 W3SVC1 61.191.61.146 GET /portal/m/c5/3.ashx r=1 80 - 202.91.18.201 myhttpClient+1.0 datacenter.mzwu.com 404 0 3
2011-04-03 02:51:13 W3SVC1 61.191.61.146 GET /portal/m/c5/3.ashx r=1 80 - 202.91.18.201 myhttpClient+1.0 datacenter.mzwu.com 404 0 3

好了,给移到新服务器的站点添加主机头datacenter.mzwu.com,问题解决。

后记:刚好是新服务器把默认站点(空主机头)关闭了,否则这个错误就不能体现在httperr中,而被隐藏在默认站点的404错误中难以发现。

评论: 0 | 引用: 0 | 查看次数: 6140
发表评论
登录后再发表评论!