Created
February 18, 2016 15:34
-
-
Save willmorgan/4a3c95c3beda3e65bceb to your computer and use it in GitHub Desktop.
SilverStripe mod_pagespeed install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule pagespeed_module> | |
ModPagespeed on | |
ModPagespeedDisallow "*/admin/*" | |
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html | |
ModPagespeedLowercaseHtmlNames on | |
ModPagespeedEnableFilters prioritize_critical_css,defer_javascript | |
ModPagespeedEnableFilters convert_jpeg_to_webp,inline_preview_images | |
ModPagespeedEnableFilters collapse_whitespace,remove_comments | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PageSpeed requires no HTTP transform restrictions: | |
HTTP: | |
cache_control: | |
no-transform: "false" | |
no-store: "false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Installing mod_pagespeed" | |
sudo yum install -y at # if you do not already have 'at' installed | |
cd /tmp | |
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm | |
sudo rpm -U mod-pagespeed-stable_current_x86_64.rpm |
Was facing the same issue. It's about the .htaccess configuration within the "assets/" folder.
Use this .htaccess configuration:
AddHandler default-handler php phtml php3 php4 php5 inc
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
RewriteCond %{REQUEST_FILENAME} !\.(webp|html|htm|xhtml|js|css|bmp|png|gif|jpg|jpeg|ico|pcx|tif|tiff|au|mid|midi|mpa|mp3|ogg|m4a|ra|wma|wav|cda|avi|mpg|mpeg|asf|wmv|m4v|mov|mkv|mp4|ogv|webm|swf|flv|ram|rm|doc|docx|dotx|dotm|txt|rtf|xls|xlsx|xltx|xltm|pages|ppt|pptx|potx|potm|pps|csv|cab|arj|tar|zip|zipx|sit|sitx|gz|tgz|bz2|ace|arc|pkg|dmg|hqx|jar|xml|pdf|gpx|kml)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* / [F]
More information: apache/incubator-pagespeed-mod#1531
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this!
I've been experiencing some issues with mod_pagespeed and silverstripe, but it could be Amazon EC2 also.
Was there any other steps to take.
This actually gets pagespeed to load on my silverstripe page, but the images don't load.
It rewrites the path to something that doesn't exist.
Thanks again,
-Helenclarko