Satış ve Destek +90 (216) 521 78 00

Sepetim Giriş Yap | Kayıt Ol
Tenik Data
How to install mod pagespeed on cpanel server - TeknikDATA Hosting Hizmetleri

Bilgi Merkezi

Ana sayfa > Bilgi Merkezi > English > cPanel > cPanel > How to install mod pagespeed on cpanel server

How to install mod pagespeed on cpanel server

mod_pagespeed speeds up your site and reduces page load time. This open-source Apache HTTP server module automatically applies web performance best practices to pages, and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow.


Automatic website and asset optimization
Latest web optimization techniques
40+ configurable optimization filters
Free, open-source, and frequently updated
Deployed by individual sites, hosting providers, CDNs


Pagespeed requires mod deflate module. You can verify this module whether installed on your server.

httpd -l | grep mod_deflate

or try to install mod deflate

How to install mod pagespeed on cpanel server?

Solution : 1

Installing mod_pagespeed for cPanel Apache installation on CentOS is really quite easy. Connect your server SSH via root user.

cd /usr/local/src

mkdir mod_pagespeed

cd mod_pagespeed

Download the mod_pagespeed RPM to build. Please make sure which arch is your server. If you have a 32-bit install of CentOS you can find your appropriate package on Google’s Installing mod_pagespeed From Packages page.

yum install at  # if you do not already have ‘at’ installed

Mostly apache version 2.2 support for this mod pagespeed version (httpd >= 2.2 is needed by mod-pagespeed-stable-


rpm2cpio mod-pagespeed-stable_current_x86_64.rpm | cpio -idmv

Copy mod file to apache module directory

cp usr/lib64/httpd/modules/ /usr/local/apache/modules/

chmod 755 /usr/local/apache/modules/

mkdir -p /var/mod_pagespeed/{cache,files}

chown nobody.nobody /var/mod_pagespeed/*

Open pagespeed configuration file.

vi /usr/local/apache/conf/pagespeed.conf

LoadModule pagespeed_module /usr/local/apache/modules/

<IfModule pagespeed_module>
    ModPagespeed on
ModPagespeedFetchWithGzip on
SetOutputFilter DEFLATE

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

ModPagespeedFileCachePath            "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix      "/var/mod_pagespeed/files/"

ModPagespeedRewriteLevel PassThrough

ModPagespeedFileCacheSizeKb          102400
ModPagespeedFileCacheCleanIntervalMs 3600000
ModPagespeedLRUCacheKbPerProcess     1024
ModPagespeedLRUCacheByteLimit        16384
ModPagespeedCssInlineMaxBytes        2048
ModPagespeedImageInlineMaxBytes      2048
ModPagespeedCssImageInlineMaxBytes   2048
ModPagespeedJsInlineMaxBytes         2048
ModPagespeedCssOutlineMinBytes       3000
ModPagespeedJsOutlineMinBytes        3000

ModPagespeedEnableFilters extend_cache,combine_css,move_css_to_head,rewrite_javascript,rewrite_images,add_head,rewrite_css,collapse_whitespace,remove_comments,remove_quotes,sprite_images,convert_meta_tags
ModPagespeedRespectVary on

    <Location /mod_pagespeed_beacon>
          SetHandler mod_pagespeed_beacon

    <Location /mod_pagespeed_statistics>
        Order allow,deny
        Allow from localhost
        Allow from
        SetHandler mod_pagespeed_statistics

Make a copy of your apache configuration httpd.conf file.

cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_back

Edit and include the pagespeed configuration.

vi /usr/local/apache/conf/httpd.conf

Include “/usr/local/apache/conf/pagespeed.conf”

Save and restart apache service.

/etc/init.d/httpd restart

Thats finished… Test your page speed modules on website headers.

curl -I

HTTP/1.1 200 OK
Date: Wed, 17 Oct 2012 06:58:03 GMT
Server: Apache
Cache-Control: max-age=0, no-cache
Vary: Accept-Encoding
Connection: close
Content-Type: text/html

You have successfully installed mod_pagespeed module on your cPanel server.


Solution : 2


Mod_Pagespeed  install using easyapache


You can install it by using following steps


tar -C /var/cpanel/easy/apache/custom_opt_mods  -xzf mod_pagespeed-cust-opts.tar.gz

Thats it, now you can run and enable mod pagespeed



Solution : 3

Install Google’s mod_pagespeed.

Create a file called /etc/yum.repos.d/mod-pagespeed.repo

For 32-Bit


For 64-Bit


Install mod_pagespeed module through Yum

yum install at  # if you do not already have ‘at’ installed

yum --enablerepo=mod-pagespeed install mod-pagespeed

Above command creates following directories and files.

/etc/cron.daily/mod-pagespeed : mod_pagespeed cron script for checking and installing latest updates.
/etc/httpd/conf.d/pagespeed.conf : The main configuration file for Apache.
/usr/lib/httpd/modules/ : mod_pagespeed module for Apache.
/var/www/mod_pagespeed/cache : File caching direcotry for web sites.
/var/www/mod_pagespeed/files : File generate prefix for web sites.

Please make sure file included in your httpd.conf.
To verify mod_pagespeed module, create php info page anywhere in your domain or localhost and check it.

phpinfo ();

You will see “X-Mod-Pagespeed” section in the HTTP header, like


Turning the Module On and Off

If you don’t want to use mod_pagespeed completely, you can Turn Off by inserting the following line to pagespeed.conf file at the top.

ModPagespeed off

Turn On module

ModPagespeed on

Thats all..

Bulut Hosting Bireysel Hosting Kurumsal Hosting Bayi Hosting Uygulama Hosting Wordpress Hosting Joomla Hosting Drupal Hosting E-Ticaret Hosting Haber Hosting Veritabanı Hosting MySQL Hosting MongoDB Hosting PostgreSQL Hosting
Bulut Sunucu Bulut Sunucu Sunucu Barındırma Sunucu Kiralama Sunucu Yük Dengeleyici Bulut Sunucu Standart Bulut Sunucu Enterprise Bulut Sunucu SSD Premium Bulut Sunucu Sunucu Yük Dengeleyici Kiralama Güvenlik Duvarı Kiralama
Kurumsal Email Sunucu Standart Email Sunucu Professional Email Sunucu Enterprise Email Sunucu Bulut Email Bulut E-Posta Hosting Hosted Zimbra Spam/Virüs Gateway Mail Back Up Smart Host ETRN Hizmeti E-Posta Servisleri
Domain Alan Adı Tescil Alan Adı Transfer Alan Adı Yenileme TÜrkçe Alan Adı Kayıt Marka Tescil Marka Tescil Başvuru
CDN Çözümleri Statik Cache Hizmeti İçerik Hızlandırma Coğrafi İçerik Dağıtımı CDN Depolama SSL Sertifika Comodo SSL QuickSSL True BusinessID SSL

LiveZilla Live Help