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
# Map it to request all through the local machine name
# And tell it to load all static stuff from the filesystem not HTTP
# 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>
- 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).
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