2

I installed pagespeed on CentOS 7 with plesk (apache 2.4).

I have 2 vhosts with different SSL certificates on the server. Pagespeed is running server-wide.

Filters such as collapse_whitespace and remove_comments work fine. But css and javascript rewrites and combines, image operations do not work.

Also, I cannot get pagespeed to run with different filters for individual vhosts.

The pagespeed.conf file in etc/httpd/conf.d is like below (i am changing things like virtual host ip and port etc):

<IfModule pagespeed_module>
    ModPagespeed On

    ModPagespeedEnableCachePurge on 
    ModPagespeedDisableRewriteOnNoTransform off 
    ModPagespeedFetchHttps enable 
    ModPagespeedFileCacheSizeKb 102400 
    ModPagespeedEnableFilters inline_google_font_css,rewrite_css,rewrite_javascript,canonicalize_javascript_libraries,extend_cache,sprite_images,rewrite_images,convert_png_to_jpeg,convert_jpeg_to_webp
        
    ModPagespeedDomain *

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
    
    ModPagespeedSslCertDirectory /etc/pki/tls
    ModPagespeedSslCertFile /etc/pki/tls/cert.pem

    <VirtualHost *:*>
      DocumentRoot /var/www/vhosts/domain.com
      ServerName "domain.com"
      ModPagespeed on
      ModPagespeedEnableFilters remove_comments,collapse_whitespace,combine_css,combine_javascript,rewrite_css,rewrite_images
    </VirtualHost>

I have tried everything on official documentation and other sources, but could not get it working. Any help is appreciated.

0

1 Answer 1

1

CSS, JS, images: These are all static files, and as you say you are using Plesk, these are normally processed by Nginx and not by Apache. So such requests will never be addressed by the rules that you have set up for Apache.

Instead, I suggest to check Plesk's KB article on Pagespeed where you can find a detailed description how to configure Plesk with the Pagespeed module. It also includes the tweaks needed for Nginx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.