1

我的问题是我在某些目录中禁用了 mod_pagespeed,但是爬虫保留了指向 pagespeed 特殊文件的 URL(以 .pagespeed.ce.{code} 结尾的文件)。以下是错误消息:

[Sun May 26 16:34:22 2013] [error] [mod_pagespeed 1.3.25.4-2941 @15589] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:22 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @15589] [0526/163422:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:22 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @15589] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404
[Sun May 26 16:34:25 2013] [error] [mod_pagespeed 1.3.25.4-2941 @6364] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6364] [0526/163425:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6364] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404
[Sun May 26 16:34:25 2013] [error] [mod_pagespeed 1.3.25.4-2941 @6379] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6379] [0526/163425:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6379] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404

我只是想知道是否有任何 mod_pagespeed 内置功能可以自动将无效路径(我之前启用 mod 但后来将其删除的路径)重定向到正确的路径(只需删除 .pagespeed.ce.{code})。

有人告诉我,只要启用 mod_pagespeed,默认情况下它通常会重写旧路径。但是,这不适用于我的情况。我仍然有 mod_pagespeed 但它不起作用。以下是我的相关配置:

conf/httpd.conf(部分)

Include conf.d/*.conf

NameVirtualHost 27.254.41.229:80
NameVirtualHost 27.254.41.227:80

<VirtualHost 27.254.41.227:80>
    DocumentRoot /var/www/sansook
    ServerName www.sansook.in.th
    ServerAlias sansook.in.th

    <Directory /var/www/sansook>
        Options -Indexes -Multiviews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    RewriteEngine On
    RewriteCond   %{HTTP_HOST} !^www\.sansook\.in\.th$ [NC]
    RewriteRule   ^(.*)$ http://www.sansook.in.th$1 [L,R=301]
</VirtualHost>

conf.d/pagespeed.conf(完整,已删除评论)

<IfModule !mod_version.c>
  LoadModule version_module /usr/lib64/httpd/modules/mod_version.so
</IfModule>

<IfVersion < 2.4>
  LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed.so
</IfVersion>
<IfVersion >= 2.4.2>
  LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed_ap24.so
</IfVersion>

<IfModule !mod_deflate.c>
 LoadModule deflate_module /usr/lib64/httpd/modules/mod_deflate.so
</IfModule>

<IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedAllow http://www.sansook.in.th/*
    ModPagespeedDisallow http://www.sansook.in.th/u/*
    ModPagespeedDisallow http://www.sansook.in.th/tmp/*

    ModPagespeedInheritVHostConfig on

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

    ModPagespeedFileCachePath            "/var/cache/mod_pagespeed/"

    ModPagespeedRewriteLevel CoreFilters
    ModPagespeedEnableFilters collapse_whitespace,combine_javascript,remove_comments

    ModPagespeedDomain *.sansook.in.th
    ModPagespeedFileCacheInodeLimit        500000
    ModPagespeedAvoidRenamingIntrospectiveJavascript on
    ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js

    <Location /mod_pagespeed_beacon>
          SetHandler mod_pagespeed_beacon
    </Location>
    <Location /mod_pagespeed_statistics>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_statistics
    </Location>
    <Location /mod_pagespeed_console>
        Order allow,deny
        # This can be configured similarly to mod_pagespeed_statistics above.
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_console
    </Location>
    ModPagespeedMessageBufferSize 100000

    <Location /mod_pagespeed_message>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_message
    </Location>
    <Location /mod_pagespeed_referer_statistics>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_referer_statistics
    </Location>
</IfModule>

apachectl -t -D DUMP_MODULES

Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 substitute_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 unique_id_module (shared)
 jk_module (shared)
 pagespeed_module (shared)
 php5_module (shared)
 ssl_module (shared)
Syntax OK

任何帮助或进一步的调查建议表示赞赏。谢谢!

-阿克

4

2 回答 2

0

如果您保持 mod_pagespeed 安装但设置为off它仍然会注意到.pagespeed.url 提供适当的资源,但不做任何其他事情。(文档链接

于 2013-06-23T15:26:56.260 回答
0

正如 Jeff 所指出的,.pagespeed.即使您拥有ModPagespeed off. 但是,由于您使用的是ModPagespeedDisallow. 在这种情况下,我们似乎仍然应该服务.pagespeed.。我为此打开了一个新错误:https ://code.google.com/p/modpagespeed/issues/detail?id=775

于 2013-09-05T19:43:59.240 回答