Results 1 to 2 of 2

Thread: How-to: mod_pagespeed for apache

  1. #1
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    8,183

    How-to: mod_pagespeed for apache

    Due to some requests that people find it difficult to install mod_pagespeed, I'm just writing a guide for now As DirectAdmin does not use RPM for Apache, and mod_pagespeed provides 'source installation' packages only for nginx, it creates difficulties for some end-customers. However, it's not as hard to install it.

    Guide for CentOS.

    We download RPM and extract it:
    Code:
    mkdir -p /root/mod_pagespeed
    cd /root/mod_pagespeed
    wget -O mod-pagespeed-stable_current_x86_64.rpm https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
    rpm2cpio mod-pagespeed-stable_current_x86_64.rpm| cpio -idmv
    Now we just move files to appropriate places:
    Code:
    mv -f ./etc/httpd/conf.d/pagespeed.conf /etc/httpd/conf/extra/pagespeed.conf
    mv -f ./etc/httpd/conf.d/pagespeed_libraries.conf /etc/httpd/conf/extra/pagespeed_libraries.conf
    mv -f ./usr/bin/pagespeed_js_minify /usr/bin/pagespeed_js_minify
    mv -f ./usr/lib64/httpd/modules/mod_pagespeed_ap24.so /usr/lib/apache/mod_pagespeed_ap24.so
    mkdir -p /var/cache/mod_pagespeed
    mkdir -p /var/log/pagespeed
    Replace '/usr/lib64/httpd/modules/' path to '/usr/lib/apache/' in /etc/httpd/conf/extra/pagespeed.conf:
    Code:
    perl -pi -e 's|/usr/lib64/httpd/modules/|/usr/lib/apache/|g' /etc/httpd/conf/extra/pagespeed.conf
    And include pagespeed.conf and pagespeed_libraries.conf to be loaded, just edit /etc/httpd/conf/extra/httpd-includes.conf, and add these lines:
    Code:
    Include /etc/httpd/conf/extra/pagespeed.conf
    Include /etc/httpd/conf/extra/pagespeed_libraries.conf
    Restart apache now:
    Code:
    service httpd restart
    Martynas Bendorius
    MC2. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  2. #2
    Join Date
    Jul 2019
    Posts
    25

    f264J

    Thanks so much for the tips.
    Do we need to make any further settings in Apache/website once this is install on the server? Or it works out of the box?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •