10/12/2017

LNMP 安裝 ngx_pagespeed module

ngx_pagespeed 穩定版本 Release 1.11.33.5-stable 這個版本僅支持 Debian、Ubuntu

如果是 RedHat、CentOS、PSOL 則用 Release 1.11.33.4-stable

latest-stable 最新的穩定版本

Release Notes 版本說明

測試環境
OS:CentOS 7 x64
Web Server:LNMP

下載 ngx_pagespeed module 與對應的 psol 版本
wget https://github.com/pagespeed/ngx_pagespeed/archive/latest-stable.tar.gz
tar zxvf latest-stable.tar.gz
rm -f latest-stable.tar.gz
cd ngx_pagespeed-latest-stable
wget https://dl.google.com/dl/page-speed/psol/1.11.33.4.tar.gz
tar zxvf 1.11.33.4.tar.gz
rm -f 1.11.33.4.tar.gz


查看原本的編譯配置,記下 nginx version 與 configure arguments
/usr/local/nginx/sbin/nginx -V


編輯升級編譯腳本
vi /root/lnmp1.3-full/include/upgrade_nginx.sh


查找
make

上面的 configure arguments
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --add-module=/root/ngx_pagespeed-latest-stable ${NginxMAOpt} ${Nginx_Modules_Options}


添加在 --prefix=/usr/local/nginx 後面
--add-module=/root/ngx_pagespeed-latest-stable


重新編譯 nginx
cd /root/lnmp1.3-full
./upgrade.sh


選擇 1: Upgrade Nginx
輸入 nginx 版本(1.10.0) 進行重新編譯,也可以順便升級

下一步配置 PageSpeed Module for Nginx 配置記憶體快取

 




 

ngx_pagespeed 對應的 PSOL 版本檔案名稱變更,增加後綴 "{NPS_RELEASE_NUMBER}-x64"
wget https://dl.google.com/dl/page-speed/psol/1.12.34.2-x64.tar.gz


及 lnmp1.4 直接從 /root/lnmp1.4/lnmp.conf 添加
Nginx_Modules_Options='--add-module=/root/ngx_pagespeed-latest-stable'


重新編譯
cd /root/lnmp1.4
./upgrade.sh nginx

沒有留言:

張貼留言