Status-Code 404 for requests to pagespeed beacon

208 views
Skip to first unread message

Karsten Kraus

unread,
Apr 28, 2016, 6:41:06 AM4/28/16
to mod-pagespeed-discuss
Hi there,

i've recently changed my setup from nginx to apache2 and can't get the Pagespeed-Beacon to work there. The request to the beacon always returns a 404 Status-Code. I'm using ProxyHTMLMeta to replace meta tags with the http-equiv-attribute that pagespeed ignores, but the problem does not seem related to that as the problem persits even if i disable ProxyHTMLMeta... Using the default-path (/mod_pagespeed_beacon) does not work also.

Is this a bug or am i doing something wrong?

Environment: Debian Jessie 8.21, Apache 2.4.20, mod_pagespeed 1.9.32.14-0

Excerpt of apache-config:

    [...]
    LoadModule filter_module modules/mod_filter.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule xml2enc_module modules/mod_xml2enc.so
    LoadModule proxy_html_module modules/mod_proxy_html.so
    # this is the file mod_pagespeed_ap24.so renamed to mod_pagespeed.so
    LoadModule pagespeed_module modules/mod_pagespeed.so
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule headers_module modules/mod_headers.so
   
    [...]
   
    ProxyHTMLEnable On
    ProxyHTMLMeta On
    # ProxyHTMLLinks is required so ProxyHTMLMeta replaces meta http-equiv
    # as we do not want our html otherwise rewritten, use some non-existing tag & attribute
    ProxyHTMLLinks none none
   
    ModPagespeed on
    ModPagespeedModifyCachingHeaders off
    # hide pagespeed-version
    ModPagespeedXHeaderValue mps
   
    ModPagespeedFileCachePath /path/to/mod_pagespeed_cache/
    ModPagespeedFileCacheSizeKb 102400
    ModPagespeedFileCacheCleanIntervalMs 3600000
    ModPagespeedFileCacheInodeLimit 500000
    ModPagespeedLRUCacheKbPerProcess 1024
    ModPagespeedLRUCacheByteLimit 16384
    ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200
    ModPagespeedRewriteDeadlinePerFlushMs 10
    ModPagespeedImageMaxRewritesAtOnce      8

    ModPagespeedStatistics on
    ModPagespeedStatisticsLogging off
    ModPagespeedStatisticsLoggingIntervalMs 60000
    ModPagespeedStatisticsLoggingMaxFileSizeKb 1024
    ModPagespeedMessageBufferSize 1000
    ModPagespeedLogDir /path/to/pagespeed_logs
   
    ModPagespeedRewriteLevel CoreFilters
    ModPagespeedPreserveUrlRelativity on
    ModPagespeedJsPreserveURLs On
    ModPagespeedImagePreserveURLs On
    ModPagespeedCssPreserveURLs On
    ModPagespeedInPlaceResourceOptimization on
    ModPagespeedEnableFilters remove_comments,collapse_whitespace,add_instrumentation
    ModPagespeedDisableFilters inline_images,lazyload_images,convert_jpeg_to_webp,convert_to_webp_lossless,defer_javascript
    ModPagespeedLoadFromFileMatch "^https?://*/static/" "/path/to/static/asset/files"
    ModPagespeedReportUnloadTime on
    ModPagespeedBeaconUrl "/pagespeed/beacon"

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/x-javascript application/javascript     application/ecmascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE image/x-icon

    ProxyPass /pagespeed !
    ProxyPass /server-status !
    ProxyPass /  http://dynamic-origin-host:port/
    ProxyPassReverse /  http://dynamic-origin-host:port/
    ProxyPass /static  http://static-origin-host:port/
    ProxyPassReverse /static  http://static-origin-host:port/

    <Location "/pagespeed/beacon">
       Require all granted
    </Location>
   
    <LocationMatch "^/pagespeed/stat.*">
        Require ip 127.0.0.1
       SetHandler mod_pagespeed_statistics
    </LocationMatch>

    <Location "/pagespeed/admin">
        Require ip 127.0.0.1
        SetHandler pagespeed_admin
    </Location>

    [...]


Logfile-Entries:

error.log:

    [...] protocol.c(616): Request received from client: GET /pagespeed/beacon?ets=load:1146&rload=1995&nav=3&dns=0&connect=0&req_start=80&ttfb=42&dwld=12&dom_c=1546&nt=0&ifr=0&url=http%3A%2F%2Fpath%2Fto%2Fserver-root%2Frun%2Fapache2-proxy.pid%3A8080%2Ftest%2Fcontent%2F HTTP/1.1
    ...
   [...] AH00128: File does not exist: /path/to/document/root/pagespeed/beacon, referer: http://server:port/test/content/

It seems that the path is not handled by mod_pagespeed at all.

access.log:

   "GET /pagespeed/beacon?ets=load:398&rload=669&nav=0&dns=1&connect=4&req_start=6&ttfb=249&dwld=19&dom_c=549&nt=0&fp=662&ifr=0&ref=http%3A%2F%2Fserver%3A8080%2Fpath&url=http%3A%2F%2Fpath%2Fto%2Fserver-root%2Frun%2Fserver-name.pid%3A8080%2Ftest%2Fcontent%2Findex.html HTTP/1.1" 404 214 "http://server:port/test/content/index.html" "<User-Agent removed>"


Could this be a bug or do i have an error in my configuration?

Kind regards

Karsten

Otto van der Schaaf

unread,
Apr 28, 2016, 4:55:55 PM4/28/16
to mod-pagespeed-discuss
You have this in your configuration:

    <Location "/pagespeed/beacon">
       Require all granted
    </Location>

Could you add the following to that block and try again?:

SetHandler mod_pagespeed_beacon

Otto

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/34c16785-953d-481d-94da-af3ea239d8d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages