Skip to content

Instantly share code, notes, and snippets.

@fduran
Created February 20, 2012 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fduran/1870492 to your computer and use it in GitHub Desktop.
Save fduran/1870492 to your computer and use it in GitHub Desktop.
Apache optimization with Google's mod_pagespeed
# apache optimization with Google's mod_pagespeed
# www.fduran.com
# Page for mod_pagespeed : http://code.google.com/speed/page-speed/docs/using_mod.html
# Download from http://code.google.com/speed/page-speed/download.html :
cd /usr/local/src
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.deb
apt-get -f install
dpkg -i mod-pagespeed-*.deb
#
check module is there:
ls -lh /etc/apache2/mods-enabled/pagespeed*
# create directives:
nano /etc/apache2/conf.d/pagespeed.conf
#with contents:
<IfModule pagespeed_module>
ModPagespeed on
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
# comment out after testing is working:
# <Location /mod_pagespeed_statistics>
# Order allow,deny
# Allow from all
# SetHandler mod_pagespeed_statistics
# </Location>
ModPagespeedEnableFilters make_google_analytics_async
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters remove_comments
</IfModule>
/etc/init.d/apache2 reload
# check in /mod_pagespeed_statistics page that numbers are different than zero, also that source of page comes "minimized" (no initial spaces)
#Also in the response headers for examle from https://www.blamestella.com , you'll see: X-Mod-Pagespeed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment