• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


Pagespeed module install, configure, monitor, errors ft nginx &apache

Installing Pagespeed module on nginx as dynamic module

first you need to compile the module on same os like ubuntu 18.04 & same nginx version nginx 13

To know version of os & nginx

You can run this commands
nginx -v
//It shows current version of nginx

to know linux distribution version

lsab- v
//
installing
risky: you can also compile & install it on a live server.
just like upgrading nginx in live server. Just we need restart / reload.
if any errors we can solve it by nginx error log.

Remove / rename old compiled module

from
mv objs/ngx_pagespeed.so  objs/ngx_pagespeed13.9so
mv /etc/nginx/modules/ngx_pagespeed.so /etc/nginx/modules/ngx_pagespeed13.9.so

Install devtools

sudo apt-get install unzip gcc make libpcre3-dev zlib1g-dev
strongly recommend that you compile dynamic modules on a separate system, which we refer to here as the “build environment
same os and same nginx.

compiling Pagespeed module with latest nginx

check version

nginx -v
nginx version: nginx/1.15.2
Download the same version of nginx to compile already covered above.

create directory

mkdir -p /etc/new/nginx/
cd /etc/new/nginx/

download latest nginx

wget -qO – http://nginx.org/download/nginx-1.15.2.tar.gz | tar zxfv –
or
wget http://nginx.org/download/nginx-1.15.2.tar.gz
tar -xzvf nginx-1.15.2.tar.gz

Download  Pagespeed Module

check latest release stable here.
check latest version and find the version number set it as variable.

Set environment variable

Include only the numeric part of the version string, not the ‑stable or ‑beta suffix.
assigning value to airbale
$ NPS_VERSION=numeric-part-of-version-string

download module

NPS_VERSION=1.13.35.2-stable
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v${NPS_VERSION}.zip
unzip v${NPS_VERSION}.zip
nps_dir=$(find . -name “*pagespeed-ngx-${NPS_VERSION}” -type d)
cd “$nps_dir”
NPS_RELEASE_NUMBER=${NPS_VERSION/beta/}
NPS_RELEASE_NUMBER=${NPS_VERSION/stable/}
psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_RELEASE_NUMBER}.tar.gz
[ -e scripts/format_binary_url.sh ] && psol_url=$(scripts/format_binary_url.sh PSOL_BINARY_URL)
wget ${psol_url}
tar -xzvf $(basename ${psol_url})
// HInt: if failed check https://dl.google.com/dl/page-speed/psol/1.13.35.1-stable.tar.gz

You will be here

/incubator-pagespeed-ngx-1.13.35.1-stable
or
$ cd ../nginx-1.15.2

//make sure to rename if already loaded module

ls /etc/nginx/modules/
mv /etc/nginx/modules/ngx_pagespeed.so /etc/nginx/modules/ngx_pagespeed13.9.so
$ ./configure –add-dynamic-module=../ngx_pagespeed-${NPS_VERSION} –with-compat
adding module in ../ngx_pagespeed-1.13.35.2-stable
./configure: error: no ../ngx_pagespeed-1.13.35.2-stable/config was found
incubator-pagespeed-ngx-1.13.35.2-stable
incubator-pagespeed-ngx-1.13.35.2-stable
./configure –add-dynamic-module=../incubator-pagespeed-ngx-${NPS_VERSION} –with-compat
$ make modules
  1. $ cd ../nginx-1.15.2
  2. $ ./configure –with-compat –add-dynamic-module=/tmp/incubator-pagespeed-ngx-1.13.35.2
  1. $ make modules
//incubator-pagespeed-ngx-1.13.35.2

Copying module & loading module in nginx.conf

  1. sudo cp objs/ngx_pagespeed.so /etc/nginx/modules/
ls /etc/nginx/modules/
/usr/lib/nginx/modules
nano /etc/nginx/nginx.conf
nginx.con top pf http
load_module modules/ngx_pagespeed.so;
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo nginx -s reload
nginx -V
at server block
Troubleshooting
PageSpeed Serf fetch failure rate extremely high; only 14 of 31 recent fetches fully successful; is fetching working?
pagespeed: rollback gzip, explicit configuration in /etc/nginx/nginx.conf:99
nginx.conf:99 gzip on;
mod_pagespeed automatically enables mod_deflate for compression.
https://blog.stackpath.com/nginx-performance-tips-google-pagespeed

Pagespeed module nginx configuration

create a directory

mkdir /var/ngx_pagespeed_cache && chown www-data:www-data /var/ngx_pagespeed_cache

add configuration

nano /etc/nginx/conf.d/pagespeed.conf
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed FileCacheSizeKb 102400;
pagespeed FileCacheCleanIntervalMs 3600000;
pagespeed FileCacheInodeLimit 500000;
pagespeed RewriteLevel CoreFilters; #PassThrough
pagespeed EnableFilters combine_css,collapse_whitespace,remove_comments,prioritize_critical_css;
pagespeed EnableFilters combine_javascript;
pagespeed EnableFilters rewrite_images;
pagespeed ModifyCachingHeaders off;
location ~ “\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+” {
add_header “” “”;
}
location ~ “^/pagespeed_static/” { }
location ~ “^/ngx_pagespeed_beacon$” { }
https://github.com/apache/incubator-pagespeed-ngx/issues/1129
nginx -t && nginx -s reload
http://blog.teamtreehouse.com/automating-web-performance-best-practices-mod_pagespeed
http://xmodulo.com/speed-nginx-web-server-pagespeed.html
Configuring
You must understand the variables and the value there is pretty guidelines available at pagespeed module websites.
Gzip
css rewrite
js
compression level
minify or combine
Put critical css on head & remaining on footer or body
to you can view the live data in browser,
Monitoring
Error handling
lot of headaches, it adds a query string to and end page page url.
Make sure to block to avoid duplicate & thin content issues from Google,

WordPress caching plugin vs Google pagespeed module vs fastCGI cache

wordpress caching plugins utilizes php backend code, MySQL+p so there is a latency.
Pagespeed module directly handles &serves with help of nginx.
limitation of pagespeed module
only optimize/ rebuild the web pages according to Google pagespeed rules.
it rebuild s & stores as cache and serves cached pages.
Cached expiration time also important.
we have lot to understand & configure in order to work with pagespeed module.
Tried for few months, upon migrating to new server not installed 3rd time.
Reason: profit/ time.
my website not drawing any users, so thought limited resources fine for limited visitors.

monitoring

http()
#pagespeedmodule
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;
pagespeed StatisticsLoggingIntervalMs 60000;
pagespeed StatisticsLoggingMaxFileSizeKb 1024;
pagespeed StatisticsPath /ngx_pagespeed_statistics;
pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
pagespeed MessagesPath /ngx_pagespeed_message;
pagespeed ConsolePath /pagespeed_console;
pagespeed AdminPath /pagespeed_admin;
pagespeed GlobalAdminPath /pagespeed_global_admin;
pagespeed UsePerVhostStatistics on;
##
Writing to mod_pagespeed_message failed. Verify that MessageBufferSize is not set to 0 in pagespeed.conf.
By default, the size of this buffer is zero, and no messages will be retained.
Apache:
ModPagespeedMessageBufferSize 100000
Nginx:
pagespeed MessageBufferSize 100000;
flush
touch /var/ngx_pagespeed_cache/cache.flush
Also read  enable brotil on nginx

troubleshoot

curl -H “PageSpeedFilters: +debug” https://raazkumar.com
?PageSpeedFilters=+debug

Pagespeed module filters

# HTTPS Support# pagespeed FetchHttps enable;
# PageSpeed Filters# CSS Minification# pagespeed EnableFilters combine_css,rewrite_css;
# JS Minification# pagespeed EnableFilters combine_javascript,rewrite_javascript;
# Images Optimization#pagespeed EnableFilters lazyload_images;#pagespeed EnableFilters rewrite_images;#pagespeed EnableFilters convert_jpeg_to_progressive,convert_png_to_jpeg,convert_jpeg_to_webp,convert_to_webp_lossless;
# Remove comments from HTML #pagespeed EnableFilters remove_comments; # Remove WHITESPACE from HTML #pagespeed EnableFilters collapse_whitespace;
# CDN Support#pagespeed MapRewriteDomain cdn.example.com www.example.com;
View Pagespeed statistics
You can view Pagespeed statics by poinitng your browser to http://example.com/ngx_pagespeed_statistics
Disable Pagespeed temporary
You can disable pagespeed temporary by using this url: http://example.com/?PageSpeed=off
pagespeed EnableFilters responsive_images,resize_images;
ou can build ngx_pagespeed by using –add-dynamic-module= instead of using –add-module=.
So you would use something like:
./configure –add-dynamic-module=/path/to/ngx_pagespeed
After running make and make install the dynamic ngx_pagespeed.so module should be located in the modules directory which resides in parallel to sbin where the nginx binary lives.
Subsequently you should be able to load ngx_pagespeed as a dynamic module by adding the following (early on) to the main context in nginx.conf:
load_module “modules/ngx_pagespeed.so”;
Just like pagespeed module letsencrypt SSL migration not possible. You may look at this.
Letsencrypt SSL Installation on apache/Nginx ubuntu / debian
Note: article updates frequently (don’t get disappointed)

Related topics:

  1. enable brotli compression nginx brotli vs gzip
  2. Apache vs nginx (connection handling, modules, memory usage)
  3. letsencrypt install configure on ubuntu / debian nginx
  4. nginx modules list (enable, disable, upgrade, install dynamic module)
  5. install wordpress on ubuntu apache nginx debian command line

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
    • Top 10 tips to improve nginx server security
    • upgrade php fpm ubuntu nginx 7.4 to 8.2
    • install phpmyadmin ubuntu nginx 22.04
    • php fpm install ubuntu 20.04 nginx
    • nginx upstream response is buffered to a temporary file
    • php fpm ondemand vs dynamic vs Static (the dynamic pool problem)
    • Php fpm configuration for 1000 concurrent connections server busy max children reached
    • php fpm seems busy fixed warning and max children reached to handle max connections / requests
    • newrelic nginx integration process and errors fix and metrics
    • datadog nginx integration installation process
    • nginx rate limiting explained by location time specific url
    • SSL faster reduce TLS hand shake improve https performance
    • monitor nginx request with nginx status amplify datadog new relic
    • nginx installation on ubuntu 20.04 LTS
    • enable brotli compression nginx brotli vs gzip
    • nginx performance tuning
    • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian wordpress
    • letsencrypt install configure on ubuntu / debian nginx
    • what is TTFB & how to Reduce it (server response time) Google pagespeed
    • php fpm restart nginx ubuntu enable status page, monitor etc
    • php fpm pool manager configuration settings based on server spike high cpu wordpress
    • nginx modules list (enable, disable, upgrade, install dynamic module)
    • nginx rewrite rules with examples 301 redirection
    • use nginx as reverse proxy and load balancer for apache wordpress
    • nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
    • nginx errors (504,502, 413, unable to start, syntax errors)
    • Pagespeed module install, configure, monitor, errors ft nginx &apache
    • Apache vs nginx (connection handling, modules, memory usage)
    • install LEMP Stack on 22.04 LTS Nginx MySQL PHP fpm #wordpress #digital ocean
    • nginx fastcgi cache wordpress how to configure
    • fix error 520 522 524 on cloudflare wordpress godaddy nginx etc
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy