New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_pagespeed_beacon returns 404 with VirtualHost #177

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 22 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

What steps will reproduce the problem?
1. install mod_pagespeed from trunk src 
2. mod_pagespeed_beacon got 404 while visit any page of my site


What is the expected output? What do you see instead?
Expect a 204 No Content


What version of the product are you using (please check X-Mod-Pagespeed
header)?

X-Mod-Pagespeed 0.9.0.0-349

Please provide any additional information below, especially a URL or an
HTML file that exhibits the problem.


on my test 0.9.13.1 didn't have this issue.

0.9.14.2 & 0.9.14.3 didn't has this issue.

but 0.9.14.3 with wrong version number (0.9.14.0-349)

0.9.14.1 can't compile complete due to lack of url_pollable_async_fetcher.h.

all of above using same config

Original issue reported on code.google.com by ericker...@gmail.com on 5 Jan 2011 at 3:59

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Are you using mod_rewrite in your config?

Original comment by jmara...@google.com on 5 Jan 2011 at 4:03

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I don't need it for mod_pagespeed. Because I config mod_pagespeed on Apache's 
config, not in .htaccess file. As I mention, I use same config in 0.9.13.1 
through latest version. only latest src has this issue.

Original comment by ericker...@gmail.com on 5 Jan 2011 at 5:57

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

And it seems has this issue since yesterday, r348. I'm not very sure about that.

Original comment by ericker...@gmail.com on 5 Jan 2011 at 6:12

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I believe you.  The change that broke your configuration was made to resolve 
compatibility issues with mod_rewrite by bypassing it for mod_pagespeed 
resources including the beacon.

But if your configuration is dependent on mod_rewrite for basic operation 
somehow, then that would explain why this change broke you.

In that case we will need to figure out a different solution or add a  
workaround.

Can you describe your network setup in detail and provide your configuration 
filesl, mod_rewrite in particular?

It is also possible that a different module is interacting with our latest fix 
in some unexpected way.  What else do you have enabled?

Can you provide the URL to your site?

Original comment by jmara...@google.com on 5 Jan 2011 at 11:31

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Here is part of my config file & Apache module that I enabled.

I'm using 0.9.14.3 on my site. Should I change to latest version for testing ?

you can check http://law.thu.edu.tw. it's one of vhosts in my site.

BTW there's another issue: mod_pagespeed will broke Mod_Security's pdf protect 
function on my site. but it's not big deal, coz for now I can use pdf 
ForcedDownload instead.

Original comment by ericker...@gmail.com on 5 Jan 2011 at 12:27

Attachments:

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

my site basically is an LAMP server. I use cPanel to provide & control around 
90+ vhosts on it. What kind of network setup you need to know ? (for 
example:....)

Original comment by ericker...@gmail.com on 5 Jan 2011 at 12:38

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks for the URL & the conf files.  The main think I'm looking for in terms 
of network configuration is anything related to your mod_rewrite rules, e.g.

    RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]

I'm not really a mod_rewrite expert (yet) but we put in the change that I think 
is affecting you in order to *prevent* mod_rewrite from corrupting URLs that 
were rewritten with mod_pagespeed.  See Issue 63 and Issue 72.

The concern I have is that mod_rewrite is also needed at a site to clean up 
some complicated internal networking configuration, such as an internal proxy 
or load balancer, and that mod_pagespeed is somehow dependent on this.  It's 
interesting that you did not report that your site was broken -- just that the 
beacon returned a 404.

We also have an internal mechanism to make this correction for the beacon in 
particular.  See 
http://code.google.com/speed/page-speed/docs/filter-instrumentation-add.html 
and the directive 
    ModPagespeedBeaconUrl "/my/path/to/beacon?ets="



Here are some things I noticed on http://law.thu.edu.tw/main.php

1. It has X-Mod-Pagespeed headers, but the server identifies itself as 
Microsoft IIS.  So this is more than a vanilla LAMP stack.  I'm guessing that 
the content origin is an IIS server but there is an Apache proxy?  Or is it the 
other way around?

2. Your X-Mod-Pagespeed header indicates that you are serving live traffic with 
the latest revision from our trunk.  But according to Firebug, the 
mod_pagespeed_beacon is returning a proper 204.

3. The first resource on the page: 
http://law.thu.edu.tw/css/general.css+wforms.css+editor.css.pagespeed.cc.3TbMcNt
ELw.css is served with the wrong Cache-Control header "public, max-age=600".  
The Cache-Control header value should be "max-age=31536000" Ordinarily, 
mod_pagespeed will correct the Cache-Control header downstream of mod_headers.  
But this has not occurred in your server and I'd like to figure out why.  I 
have not seen this on any other site.


Original comment by jmara...@google.com on 5 Jan 2011 at 1:12

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

1. Well, "Microsoft IIS" is fake header :) it's actually Apache.

2. No, I'm using 0.9.14.3. I've compared trunk/src and tags/0.9.14.3/src, they 
are not the same. Even though it shows 0.9.14.0-349 in X-Mod-Pagespeed header, 
but it only r437 ( I've checked the src). 0.9.14.3 works well, but latest trunk 
has issue.


Original comment by ericker...@gmail.com on 5 Jan 2011 at 2:06

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I've check the resource you mention above. it shows

X-Mod-Pagespeed-Repair  max-age=31536000
Cache-Control   max-age=31536000

I didn't change any config. so maybe sometimes mod_pagespeed can't change 
Cache-Control header?

Original comment by ericker...@gmail.com on 5 Jan 2011 at 2:19

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Exactly -- there's something wrong here and I'm not sure whether it relates to 
your original problem or not.

I posted a message to modules-dev already describing the technique we use to 
override Cache-Control, which has worked well until I saw your site, and asked 
them what could go wrong.  You do have a lot of modules loaded in your .conf 
file:

Include "/usr/local/apache/conf/mod_mono.conf"
Include "/usr/local/apache/conf/php.conf"
Include "/usr/local/apache/conf/includes/errordocument.conf"
Include "/usr/local/apache/conf/jk.conf"
Include "/usr/local/apache/conf/mod_bandwidth.conf"
Include "/usr/local/apache/conf/modsec2.conf"

I'm not sure what all of these do or whether they could affect the cache-header 
repair that mod_pagespeed does.  We will be investigating this for sure.

Original comment by jmara...@google.com on 5 Jan 2011 at 2:24

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

maybe it due to I have following setting in post_virtualhost_global.conf

<FilesMatch "\.(js|css)$">
        ExpiresDefault A10800
        Header unset Etag
        Header set Cache-control "public, max-age=600"
</FilesMatch>

mod_pagespeed setting in this config file too.

Original comment by ericker...@gmail.com on 5 Jan 2011 at 2:39

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I don't believe it's caused by that stanza -- that's very common, and 
mod_pagespeed is designed to override the headers set from such constructs but 
it's not working on your site.  I think it might be due to one of the other 
modules you've loaded which might be bypassing the normal Apache filter-chain 
somehow and preventing our cache-control repair filter from running.

Original comment by jmara...@google.com on 5 Jan 2011 at 2:59

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Include "/usr/local/apache/conf/mod_mono.conf"
this is for Apache support ASP.NET 2.x

Include "/usr/local/apache/conf/php.conf"
this is for php

Include "/usr/local/apache/conf/includes/errordocument.conf"
this is config to use custom error page

Include "/usr/local/apache/conf/jk.conf"
this is for Tomecat

Include "/usr/local/apache/conf/mod_bandwidth.conf"
this is for bandwidth control

Include "/usr/local/apache/conf/modsec2.conf"
this is for mod_pagespeed 2.x


Original comment by ericker...@gmail.com on 5 Jan 2011 at 4:24

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I have split off the Cache-Control problem into 
http://code.google.com/p/modpagespeed/issues/detail?id=179

Let's keep this bug pertaining to mod_pagespeed_beacon.  Are you still seeing 
the error on trunk?

Original comment by jmara...@google.com on 5 Jan 2011 at 6:52

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I've rebuild entire Apache & its module, and get latest trunk. But missing 
mod_pagespeed_beacon issue still there. I'll let this version run for a 
while(if it won't break anything).

Original comment by ericker...@gmail.com on 6 Jan 2011 at 1:31

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Is this the same as http://code.google.com/p/modpagespeed/issues/detail?id=156 ?

I've confirmed just now that the beacon issue is still there.  I think there's 
an interaction between VirtualHost and mod_pagesspeed_beacon that needs to be 
sorted out.

Original comment by jmara...@google.com on 14 Jan 2011 at 6:55

  • Changed title: mod_pagespeed_beacon returns 404 with VirtualHost
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I don't think this is the same as issue 156.

Because in that build, my site's beacon works normal.

this issue happens since r348.



Original comment by ericker...@gmail.com on 15 Jan 2011 at 4:20

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by matterb...@google.com on 9 Feb 2012 at 4:25

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 17 May 2012 at 7:33

  • Added labels: Milestone-v23
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 24 May 2012 at 7:15

  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Are you still running mod_pagespeed? http://law.thu.edu.tw/main.php does not 
appear to.

Also, if you're using php, could you download the latest trunk src, build, and 
test that please, as a bug has been fixed that *might* be related.

Original comment by matterb...@google.com on 27 Aug 2012 at 6:00

  • Changed state: RequestClarification
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I am closing this bug because I believe it is fixed by the fix for issue 385
http://code.google.com/p/modpagespeed/issues/detail?id=385

and because the OP has not responded to our last request.

Original comment by matterb...@google.com on 29 Oct 2012 at 5:22

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment