How to speed up Apache with Pagespeed

I came back, that's right, I was partying, nothing dead or anything like that hahaha. ok, let's get to the point, I really didn't know what to name this post ... because I'm so impressed with this add-on that I was looking for names that would describe the feeling and the good taste that I got the results when I installed this add-on on my web servers. I thought about putting something like fast and furious Apache challenge hahahaha, but well, it's already exaggerated, also this type of joke is not given to me -.-

Apache

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb

Debian and derivatives

sudo dpkg -the mod-PageSpeed- *.deb sudo apt-get -f install

Redhat and derivatives

sudo yum install at  # if you do not already have 'at' installed
sudo rpm -u mod-PageSpeed- *.rpm

Once installed, this is what you will find new

  • The mod_pagespeed package installs 2 versions of the code by itself, one is, mod_pagespeed.so for Apache 2.2 and mod_pagespeed_ap24.so for Apache 2.4.
  • The configuration files: pagespeed.conf, pagespeed_libraries.conf, and (Debian) pagespeed.load. Note that if I inform you, mod_pagespeed already brings a default configuration (optimal), however you can modify these configuration files to your liking or need, if you modify them these files will not be automatically updated in the future.
  • A standalone JavaScript minifier (compressor) pagespeed_js_minify based on the same used in mod_pagespeed, which can compress JavaScript and generate metadata for libraries.

Update

Redhat and derivatives

sudo yum update mod-pagespeed-beta # Or mod-pagespeed-stable sudo /etc/init.d/httpd restart

Debian and derivatives

sudo apt-get update sudo apt-get upgrade sudo /etc/init.d/apache2 restart

Switch between stable or beta versions

Redhat and derivatives

sudo yum remove mod-pagespeed-stable sudo yum install mod-pagespeed-beta

Debian and derivatives

sudo apt-get remove mod-pagespeed-stable sudo apt-get install mod-pagespeed-beta

configurations

The filter used to analyze, optimize and restructure all HTML content that is generated in some way by the Apache server

# Direct Apache to send all HTML output to the mod_pagespeed output handler.
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

Note: It is automatically enabled mod_deflate to compress.

Disabling or Enabling mod_pagespeed

To enable or disable mod_pagespeed ON, insert at the top of pagespeed.conf:

modpagespeed on

There are 2 ways to disable mod_pagespeed. To disable HTML rewriting but continue distributing resources and analyzing query options (querys) (For instances of ?ModPagespeed=on) put this option in your settings.

modpagespeed off

To completely disable mod_pagespeed (elements like .pagespeed. Will result in the famous 404s error) we use the following line:

modpagespeed unplugged

Something important is that the ON and OFF options can be written in the famous .htaccsess on the label <Directory>, query parameters, and headers. The state of unplugged It can only be used in the primary level of the apache configuration and the virtual hosts, that is, where you place your site-avalible. Obviously and so that there is no doubt if you enable it ModPagespeed on on a virtual host, the top options will be overwritten even of the unplugged type.

Then soon to install in nginx, and by the way I await your comments as always!
Thank you


Add as preferred source in Google