Learn about Centmin Mod LEMP Stack today
Become a Member

Wordpress Convert Super cache to fastcgi cache + pagespeed

Discussion in 'Blogs & CMS usage' started by Peih, May 30, 2016.

  1. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    hello,
    can anyone help me to convert a wordpress super cache to fastcgi cache + pagespeed step by step?
     
  2. RoldanLT

    RoldanLT Well-Known Member

    3,930
    960
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,311
    Local Time:
    6:55 AM
    1.11
    10.2
  3. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    [root@sv ~]# nginx -t
    nginx: [emerg] dlopen() "/usr/local/nginx/modules/ngx_pagespeed.so" failed (/usr/local/nginx/modules/ngx_pagespeed.so: cannot open shared object file: No such file or directory) in /usr/local/nginx/conf/dynamic-modules.conf:2
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

    [root@sv ~]# nginx -V
    nginx version: nginx/1.11.0
    built by clang 3.4.2 (tags/RELEASE_34/dot2-final)
    built with LibreSSL 2.3.4
    TLS SNI support enabled
    configure arguments: --with-ld-opt='-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib' --with-cc-opt='-m64 -mtune=native -mfpmath=sse -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-sign-compare -Wno-string-plus-int -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-const-variable -Wno-conditional-uninitialized -Wno-mismatched-tags -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-parentheses-equality -Wno-tautological-compare -Wno-self-assign -Wno-deprecated-register -Wno-deprecated -Wno-invalid-source-encoding -Wno-pointer-sign -Wno-parentheses -Wno-enum-conversion -Wno-c++11-compat-deprecated-writable-strings -Wno-write-strings' --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_stub_status_module --with-http_secure_link_module --with-openssl-opt=enable-tlsext --add-module=../nginx-module-vts --with-libatomic --with-threads --with-http_gzip_static_module --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-http_realip_module --add-module=../ngx-fancyindex-0.3.6 --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_devel_kit-0.3.0 --add-module=../set-misc-nginx-module-0.30 --add-module=../echo-nginx-module-0.59 --add-module=../redis2-nginx-module-0.13 --add-module=../ngx_http_redis-0.3.7 --add-module=../nginx_upstream_check_module-0.3.0 --add-module=../memc-nginx-module-0.17 --add-module=../srcache-nginx-module-0.31 --add-module=../headers-more-nginx-module-0.30 --with-pcre=../pcre-8.38 --with-pcre-jit --with-http_ssl_module --with-http_v2_module --with-openssl=../libressl-2.3.4

    try to compile with centmin 4:
    ../ngx_pagespeed-release-1.10.33.5-beta/src/ngx_pagespeed.cc:685:39: error: 'NGX_CONF_MULTI' was not declared in this scope
    NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1|NGX_CONF_MULTI|
    ^
    ../ngx_pagespeed-release-1.10.33.5-beta/src/ngx_pagespeed.cc:692:38: error: 'NGX_CONF_MULTI' was not declared in this scope
    NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1|NGX_CONF_MULTI|
    ^
    ../ngx_pagespeed-release-1.10.33.5-beta/src/ngx_pagespeed.cc:700:56: error: 'NGX_CONF_MULTI' was not declared in this scope
    NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1|NGX_CONF_MULTI|
    ^
    make[1]: *** [objs/addon/src/ngx_pagespeed.o] Error 1
    make[1]: Leaving directory `/svr-setup/nginx-1.11.0'
    make: *** [install] Error 2
     
    Last edited: May 30, 2016
  4. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    see news thread at Nginx 1.9.11 dynamic module compatibility

    123.08stable has disabled ngx_pagespeed and lua nginx modules due to incompatibility with nginx 1.9.11 dynamic modules. If you want ngx_pagespeed for now you need to update Centmin Mod to 123.09beta01 outlined here Beta Branch - Centmin Mod .09 beta branch Testing

    With 123.09beta01, set in /etc/centminmod/custom_config.inc persistent config file you create or already created and set:
    Code:
    NGINX_PAGESPEED=y
    and then recompile Nginx 1.9.15+ or higher via centmin.sh menu option 4
     
  5. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    i'm using 123.09beta01 and set "NGINX_PAGESPEED=y" in /etc/centminmod/custom_config.inc.
    But the error is still same.
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    latest is 1.11.0, but that suggests 1.10.33.5 so ensure there is no version set in /etc/centminmod/custom_config.inc and update to latest 123.09beta01 code via centmin.sh menu option 23 submenu option 2 first then exit centmin.sh and re-run centmin.sh menu option 4

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    So essentially, you can upgrade from .07 to .08 in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to .08's configuration, then you would need a fresh OS install and fresh .08 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.
     
  7. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    i did but still the same.

    i dont understand..so in /etc/centminmod/custom_config.inc should be:
    NGXDYNAMIC_NGXPAGESPEED=y
    NGINX_PAGESPEED=y

    or

    NGXDYNAMIC_NGXPAGESPEED=y
    NGINX_PAGESPEED=y
    NGXPGSPEED_VER='1.10.33.5'
    NGINX_PAGESPEEDPSOL_VER='1.10.33.5'
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  9. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
  10. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
  11. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    now i have configured and turn on fastcgi + pagespeed so what do i need to turn off super cache? i created a domain wordpress with super cache.
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    If you have enabled forum admin mailings you would of gotten security and important update announcements ;)
    basically, backup existing vhost config for safe keeping

    then reverse the changes you see suggested at WordPress + Super Cache plugin for Centmin Mod Nginx | wp1.centmincache.com and apply fastcgi_cache ones

    FYI fastcgi_cache no longer works with latest ngx_pagespeed, so would need to disable ngx_pagespeed anyway
     
  13. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    thank you!
    ngx_papespeed no longer works with fastcgi_cache so can i use w3 total cache to minify code or do you have any recommendation?
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    autooptimize plugin works fine :)
     
  15. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    can you give me the plugin link? if i use w3tc, is there any trouble?
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
  17. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    i test my site speed and pingdom said: avoid redirect landing page (44point). then i check again my domain conf (domain.com.ssl.conf):

    server {
    server_name domain.com www.domain.com;
    return 302 https://domain.com$request_uri;
    }
    server {
    listen 443 ssl http2;
    server_name domain.com www.domain.com;
    ...
    }

    but to avoid redirect, i put # in front of server like this:
    #server {
    # server_name domain.com www.domain.com;
    # return 302 https://domain.com$request_uri;
    #}
    server {
    listen 443 ssl http2;
    server_name domain.com www.domain.com;
    ...
    }

    and my website become http://Domain.com that is Welcome Nginx Page.
    how can i avoid redirect page but still use https ?
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    not those redirects it means redirects in your advertising or js/css ads some have alias domains in 3rd party scripts which redirect to others, run site through gtmetrix.com for clearer picture

    see Avoid URL redirects | GTmetrix and PageSpeed Insights Rules | PageSpeed Insights | Google Developers

    and Avoid Landing Page Redirects  |  PageSpeed Insights  |  Google Developers

    but you need 301 for http to https so no way to avoid that and pingdom and gtmetrix are just guides not rules set in stone and some are unavoidable
     
  19. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    4:55 PM
    i dont have any advertising now. default wordpress template (sixteen).

    i forced to turn http to https by changing to domain.conf-disabled. but it's weird bcos if i put the hash in front of "server" as i wrote above, it becomes Welcome Nginx Page but when i remove the hash it redirect to https that pingdom and gtmetrix advie to fix avoid redirect url.

    then i try to turn off SSL in cloudflare and the issue is "The page isn't redirecting properly". its usually turned Full SSL on.
     
  20. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    8:55 AM
    Nginx 1.13.x
    MariaDB 5.5