Diễn đàn

INSTALL GOOGLE MOD_PAGESPEED ON CENTOS WITH DIRECTADMIN

Được tạo bởi Việt Nam · 0 Trả lời
Avatar

Việt Nam


50 Năm trước

Đã đăng: 2 tháng trước
Google released an open source Apache module to simplify the optimization of your content. The module, mod_pagespeed, will do all sorts of magic like minify your JS/CSS and optimize images, and a handful of other optimizations that seem (from limited testing) to improve your servers performance considerably.


First see how your site is doing right now, when you are done with the mod_pagespeed installation you can do another test to see if you have improved. Go to https://developers.google.com/speed/pagespeed/insights and check your score and remember it!

So if you want to install mod_pagespeed, follow this procedure (64-bit):

cd ~
yum install at
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
We have to install it with dependency check disabled, because with DirectAdmin httpd is installed from source:

rpm -i --nodeps mod-pagespeed-stable_current_x86_64.rpm
Now we have to edit some files.

Open file: /etc/httpd/conf/extra/httpd-includes.conf and add this line:

#Google PageSpeed Module
Include /etc/httpd/conf.d/pagespeed.conf
Open file: /etc/httpd/conf/httpd.conf and remove this line or comment it:

Include conf/extra/httpd-deflate.conf
If you’d like to change the options for PageSpeed, it’s configuration file is located in /etc/httpd/conf.d/pagespeed.conf.

Once everything is set, we’ll need to restart Apache and test to see if the module loaded properly:

service httpd restart
and

apachectl -t -D DUMP_MODULES
Check if you see “pagespeed_module (shared)” loaded.

Mod Pagespeed is loaded
Mod_Pagespeed is loaded

Now check if your site has indeed speeded up.

You should also check any .htaccess files you may use and remove any instances of ‘setoutputfilter’ as this will probably override what mod_pagespeed is doing.

There you have it! Load up a copy of FireFox with the PageSpeed installed and check out how your score has improved. In my case, with all other caching disabled, I went from a score of 67 to an 84. Not a bad improvement if you ask me!
Chia sẻ trên dòng thời gian của tôi