Re: Problem with pagespeed missing out other Apache filters/directives

195 views
Skip to first unread message
Message has been deleted

Matt Atterbury

unread,
Nov 5, 2012, 8:27:20 AM11/5/12
to mod-pagesp...@googlegroups.com
G'day!

I haven't digested everything in here yet but a few quick comments:
* Removing the X-Mod-Pagespeed header should be safe - it's there to stop loop problems when Apache fetches already optimized content.
* The current stable release has some bugs with header handling that are fixed with the latest source build.
  IF you are able to, could you build from source and try that version?

On Mon, Nov 5, 2012 at 2:31 AM, Pete Storey <petes...@gmail.com> wrote:
Hi

I've got a weird problem I can't trace at the moment with mod_pagespeed.  I'm running the latest build (1.0.22.7) on Centos 5.8, with Apache 2.2.3-65 (in Centos parlance).  I'm running the Apache server with pagespeed, which then connects to a Tomcat server using mod_jk to generate most of the content;  Apache is serving most static content from local resources however, and all of it is processed by pagespeed.

This all works fine and dandy for most of the time, however under certain circumstances, it seems that the core Apache directives are being skipped when pagespeed is running, which is mighty strange.  Let me explain:

- There are in fact two identical Apache servers, they have a clustered load balancer in front of them, and behind a pair of Tomcat servers - though individually they are configured only to talk to one of them, so web server 1 talks only to tomcat server 1 and so on. 

- In the core httpd.conf file, there is a directive for the whole server:

# Add generating server ID
Header always set GenSvr 01

which, you'd imagine would always set this header.

- I then have a generic pagespeed.conf file included from conf.d of:

<IfModule pagespeed_module>
    ModPagespeed off
    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER;DEFLATE text/html
    ModPagespeedFileCachePath            "/var/www/mod_pagespeed/cache/"
    ModPagespeedGeneratedFilePrefix      "/var/www/mod_pagespeed/files/"
</IfModule>

- then in each virtual host I have the following config:

# Turn on Pagespeed
    Include conf.d/pagespeed.conf.inc

# Deal with the Pagespeed mappings
    ModPagespeedDomain http://itrek.lnweb01.internal
# Map it to request all through the local machine name
    ModPagespeedMapOriginDomain itrek.lnweb01.internal *.itrektravelinsurance.com.au
# And tell it to load all static stuff from the filesystem not HTTP
    ModPagespeedLoadFromFile "http://www.itrektravelinsurance.com.au/assets/" "/var/www/html/itrek/$
    ModPagespeedLoadFromFile "http://itrek.lnweb01.internal/assets/" "/var/www/html/itrek/$
# Remove the header - no reason to publish it
    Header unset X-Mod-Pagespeed

- and you'll notice that this includes a config file which actually enabled pagespeed for that virtual host:


<IfModule pagespeed_module>
    ModPagespeed on

    ModPagespeedFileCachePath            "/var/www/mod_pagespeed/cache/"
    ModPagespeedGeneratedFilePrefix      "/var/www/mod_pagespeed/files/"

    ModPagespeedEnableFilters remove_quotes
    ModPagespeedEnableFilters move_css_to_head
    ModPagespeedEnableFilters insert_image_dimensions

    ModPagespeedEnableFilters trim_urls

    ModPagespeedEnableFilters collapse_whitespace
    ModPagespeedDisableFilters combine_css

    ModPagespeedAvoidRenamingIntrospectiveJavascript on

    <Location /mod_pagespeed_statistics>        
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        Allow from 172.16.200.1
        SetHandler mod_pagespeed_statistics
    </Location>

    ModPagespeedMessageBufferSize 100000

    <Location /mod_pagespeed_message>
        Allow from localhost
        Allow from 127.0.0.1
        Allow from 172.16.200.1
        SetHandler mod_pagespeed_message
    </Location>

</IfModule>

- So that's roughly our setup.  Also in the virtual host config, after the pagespeed stuff is a JkMount /* mysite which maps everything on to Tomcat, plus some JkUnMount /*.ext directives for various static extensions (e.g. *.png).

Since it's easier for me to show you what I mean, the website in question is http://www.itrektravelinsurance.com.au/ 

Now, the problem I have is that if you go to a statically generated page (though still a Tomcat served one) such as, say http://www.itrektravelinsurance.com.au/travel/faq.html , and look at the response headers, all is well - there's as expected a GenSvr header, and no X-Mod-Pagespeed header.  But when I go to, say, the homepage, or any page in the quote path of the site, I get a different set of headers - there's no GenSvr header, it hasn't removed various other unwanted ones, and there is an X-Mod-Pagespeed one.  

Whilst this doesn't _appear_ to cause any functional problems on the site, it suggests that all is not well (and it is often a problem not being able to see which server you are going through).  I cannot for the life of me work out how I am getting served those headers - what set of circumstances allow it to process some things and serve the correct content, but for others skip various parts of the setup?  It only seems to happen when serving Tomcat content, but it's also only for certain sections of it.  

Any ideas would be very welcome!

BTW I know that you're not supposed to remove the X-Mod-Pagespeed header, but I don't especially like it being there and I don't _think_ that could be the issue?

thanks
Pete

Matt Atterbury

unread,
Nov 6, 2012, 9:36:12 AM11/6/12
to mod-pagesp...@googlegroups.com
OK, so it's nothing to do with headers being flushed.

Could you please either post or email to me directly (matterbury@) your httpd.conf?
Please be sure to redact it as you feel necessary.

My current suspicion is that it's related to your VHost setup but I need to see more to test this.

cheers, m.

On Mon, Nov 5, 2012 at 11:42 PM, Pete Storey <petes...@gmail.com> wrote:
OK tried that, it runs OK but the latest build doesn't fix the problem - now I just get the same but with a header 
X-Mod-Pagespeed:
0.10.0.0-2144

Hmm, any other ideas? I _think_ this used to work, but I can't be totally sure and I can't really rewind production servers to test it :(



--
"Klaatu barada nikto"                          (754) 444-6288
Reply all
Reply to author
Forward
0 new messages