1

Web ページでドキュメントの年齢を確認したいのですが、表示されません。サーバーへの 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.

別のサーバーには、上記にない次の 2 行も含まれています。

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

だから私はインターネットを検索し、私が理解できる限り、Apacheにヘッダーを設定し、htaccessでetagを設定するための構成があるはずです。しかし、それを示す場所を見つけることができませんでした。

役立つ場合は、Apache にロードされたモジュールを次に示します。

core 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_expires mod_headers 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は、有効にする必要があります。

これについて何か助けはありますか?

編集: 提案された解決策を試しました: ここにアップロードしないでくださいという名前のファイルがあっても、/ フォルダーに .htaccess ファイルを配置します。.htaccess の内容:

    <code>
    # 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>
     </code>

このファイルを public_html フォルダーと、ファイル update.ver が存在するサブフォルダー nod_update3 に配置します。次に、次のようにドキュメントの年齢をチェックするスクリプトを実行します。 0,159 秒の応答時間で 26316 バイト |time=0,158965s;;;0,000000 size=26316B;;;0

ご覧のとおり、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 - 最終更新日 13,5 日前 - 1,059 秒の応答時間で 56472 バイト |time=1,059014s;;;0,000000 size=56472B;;;0 srvmon plugins #

ご覧のとおり、日付の変更はわかっています。なぜverファイルに問題があるのですか?ファイルは次の URL で確認できます: http://av.hostoi.com/nod_update3//update.ver

4

2 に答える 2

0

問題は、最初のサーバーで静的コンテンツのキャッシュが有効になっていて、2 番目のサーバーでは有効になっていないことです。

次のようなものがある場合は、Apache のメイン構成ファイル、仮想ホスト、または 2 番目のサーバーの .htacess を調べてください。

<IfModule mod_expires.c>
FileETag MTime Size
ExpiresActive on

<filesMatch "\.ver$">
ExpiresDefault "modification plus 2 week"
</filesMatch>
</IfModule>

また、Apache モジュール mod_expires を有効にする必要があります。

お役に立てれば!

于 2012-10-24T13:56:58.380 に答える
0

Apache のソース コードをたどると、この構成ミスの根本的な原因は、「Xbithack Full」によって有効化されたセマンティクスが、「SSILastModified On」によって有効化されたセマンティクスを暗黙的に上書きすることであることがわかります。

if (conf->lastmodified > 0) {
  ... {
   ap_update_mtime(r, r->finfo.mtime);
   ap_set_last_modified(r);}}

else if (((conf->xbithack == XBITHACK_FULL ||
         (conf->xbithack == XBITHACK_UNSET &&
                DEFAULT_XBITHACK == XBITHACK_FULL))
        ...)) {
        ap_update_mtime(r, r->finfo.mtime);
        ap_set_last_modified(r);
}

ここで考えられる解決策の 1 つは、「SSILastModified on」を「Xbithack Full」に置き換えることです。

于 2021-02-24T00:43:08.760 に答える