网页未知的最后修改date

我想检查网页中文档的年龄,但不显示! 这里是telnet到服务器的结果:

telnet av.hostoi.com 80 Connected to av.hostoi.com. HEAD / HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 23 Oct 2012 16:55:40 GMT Server: Apache X-Powered-By: PHP/5.2.17 Connection: close Content-Type: text/html Connection closed by foreign host. 

在另一台服务器上,还包括以下两行:

 Last-Modified: Fri, 17 Jun 2011 11:17:45 GMT ETag: "2ce392-b1-4a5e688eae840" 

所以我search了互联网,据我所知,应该有一个configuration在Apache中设置标题和etag在htaccess? 但是我找不到任何可以certificate这一点的地方。

这里是在Apache的加载模块,如果它会帮助:

mod_authn_file模块核心mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include负责mod_filter mod_log_config mod_env mod_headers中指定mod_expires mod_setenvif mod_version prefork的http_core mod_mime mod_status的mod_autoindex mod_asis mod_info mod_vhost_alias mod_negotiation模块mod_dir mod_actions mod_alias中的mod_rewrite mod_so mod_php5 mod_ruid2

据我看,mod_header必须启用这似乎是这样的情况?

编辑:尝试build议的解决scheme:即使有一个名为不要上传的文件,在.htaccess文件放在/文件夹。 .htaccess的内容:

 #Do not remove this line, otherwise mod_rewrite rules will stop working RewriteBase / Options -Indexes SSILastModified on <IfModule mod_expires.c> FileETag MTime Size ExpiresActive on ExpiresDefault "access plus 10 days" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType application/x-shockwave-flash "access plus 1 week" ExpiresByType text/css "access plus 1 week" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/x-icon "access plus 6 month" ExpiresByType image/ico "access plus 6 month" </IfModule> 

我把这个文件在public_html文件夹和文件update.ver存在的子文件夹nod_update3。 然后我执行检查文档年龄的脚本,如下所示:

 ./check_http -H av.hostoi.com -u /nod_update3/update.ver -M 2d HTTP CRITICAL: HTTP/1.1 200 OK - Document modification date unknown - 26316 bytes in 0,159 second response time |time=0,158965s;;;0,000000 size=26316B;;;0 

你可以看到没有修改date显示,即使在ftp客户端,它显示它是最后修改25.10.2012

我试图检查在同一文件夹中的另一个文件,如下所示:

 ./check_http -H av.hostoi.com -u /nod_update3/em000_32_l0.nup -M 2d HTTP CRITICAL: HTTP/1.1 200 OK - Last modified 13,5 days ago - 56472 bytes in 1,059 second response time |time=1,059014s;;;0,000000 size=56472B;;;0 srvmon plugins # 

因为你可以看到date修改是已知的。 那么为什么与ver文件的问题? 该文件可以在这个URL中检查: http : //av.hostoi.com/nod_update3//update.ver

 X-Powered-By: PHP/5.2.17 

看起来这个页面是由PHP生成的,在这种情况下,Apache不知道最后修改的tamestamp。 在这种情况下,PHP脚本有责任设置Last-Modified标题,而这显然不是。

如果这些只是静态文件,那么您可能希望将Apacheconfiguration为直接提供,而不是通过PHP脚本提供。 如果它们不是静态文件,则需要修复PHP脚本以适当地设置Last-Modified标头。

我们终于搬到一个新的托pipe服务提供商,现在一切正常。 感谢您的帮助和圣诞快乐。 这是检查的结果。

 srvmon plugins # ./check_http -H baza32.info -u /nod_update3/update.ver -M 3d HTTP OK: HTTP/1.1 200 OK - 26168 bytes in 0,219 second response time |time=0,218608s;;;0,000000 size=26168B;;;0