A good way to enhance the pace of your internet server on Linux is with the Google PageSpeed module. Enabling Google’s PageSpeed Module on Apache or Nginx ends in web page loading speeds as much as 10X quicker.

Apache Directions

Apache is the popular internet server on most Linux installations. In consequence, Google prefers customers to go this route when utilizing it. When you’re utilizing Ubuntu server, Debian server, Fedora server, Redhat Enterprise Linux, CentOS and even Suse Enterprise Linux, observe alongside to get the plugin working.

Word: Google doesn’t assist server working techniques operating Apache that don’t use DEB or RPM. To use on different platforms, the NGINX internet server is really useful.

Ubuntu Server/Debian  Server

Getting the PageSpeed module engaged on each Debian and Ubuntu server working techniques is refreshingly simple as Google gives a downloadable binary package deal. This package deal comprises the module in addition to an official software program repository guaranteeing that the module will at all times be updated.

Begin off by downloading the package deal utilizing the wget downloader software.

wget 

or

wget 

Alternatively, obtain the beta launch of the module with:

wget 

or

wget 

The Pagespeed package deal isn’t massive, so the obtain received’t take lengthy. When it finally ends up, the following step within the course of is to put in the package deal to the system by way of dpkg.

sudo dpkg -i mod-pagespeed-stable_current_*.deb

or

sudo dpkg -i mod-pagespeed-beta_current_*.deb

Putting in the module by way of dpkg ought to work flawlessly, with none dependency points. If, for some motive dependency errors come up, appropriate them with the next command:

sudo apt set up -f

RHEL/CentOS

9k=

Like Ubuntu, RHEL and CentOS customers seeking to get Google’s PageSpeed module don’t have to run by an advanced course of. As an alternative, there’s a handy RPM file prepared for obtain. To begin the set up course of, use the wget software to obtain the package deal.

To get the most recent steady model of Mod_pagespeed, strive:

wget 

or

wget 

For the beta model, do:

wget 

or

wget 

Utilizing the RPM command, set up Mod_pagespeed.

sudo rpm -U mod-pagespeed-*.rpm

Nginx Directions

Together with Apache, Google’s PageSpeed module additionally has assist for Nginx. Nevertheless, in contrast to Apache, there are not any handy binary packages to obtain. As an alternative, these trying to make use of it have to get it by hand.

To begin the module set up on Nginx, enter the next command. Operating this command will execute an automated script that units the whole lot up.

Word: with a view to use this script, curl is required. Search for “curl” within the package deal supervisor and set up it earlier than persevering with.

bash <(curl -f -L -sS  
     --nginx-version newest

When the script is full, the Nginx Pagespeed module needs to be working.

Configure PageSpeed

Putting in the PageSpeed module for the Apache internet server requires no configuration. On Nginx, nonetheless, it does. To allow the module throughout the Nginx webserver, edit the nginx.conf file. Within the terminal, achieve root, then open up the configuration file utilizing Nano.

su -

or

sudo -s
nano /and so on/nginx/nginx.conf

Within the configuration file, paste the next code:

pagespeed on;
# Must exist and be writable by nginx. Use tmpfs for greatest efficiency.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Guarantee requests for pagespeed optimized assets go to the pagespeed handler
# and no extraneous headers get set.
location ~ ".pagespeed.([a-z].)?[a-z]{2}.[^.]{10}.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

Save the configuration file by urgent Ctrl  + O, and exit with Ctrl + X.

Disable PageSpeed

Google’s PageSpeed module makes a huge effect on efficiency for web sites. Nonetheless, if you happen to’re not pleased with the outcomes, for no matter motive, you might need to disable it. Disabling the module is straightforward on each servers.

Apache

On Apache, there are a couple of methods to disable the module, however by far the best means is to only uninstall the binary package deal. Doing this can routinely clear any residual configuration recordsdata and libraries from the system.

Debian/Ubuntu

sudo apt take away mod-pagespeed

or

sudo apt take away mod-pagespeed-beta

RHEL/CentOS

sudo yum take away mod-pagespeed

or

sudo yum take away mod-pagespeed-beta

Nginx

Disabling the module on Nginx can also be easy. To flip off the module, edit the Nginx configuration file and set PageSpeed from “on” to “off”.

su -

or

sudo -s

nano /and so on/nginx/nginx.conf

Discover “pagespeed on;” and alter it to:

pagespeed off;

After altering the worth, exit Nano.  PageSpeed ought to immediately flip off.



Source link

Share.
Leave A Reply

Exit mobile version