Want more timely Centmin Mod News Updates?
Become a Member

Wordpress Cache-Enabler Plugin WP Cacher Enabler Plugin by KeyCDN folks

Discussion in 'Blogs & CMS usage' started by eva2000, Dec 2, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    best to post the original nginx vhost conf files so i can visually see what you saw originally :)

     
  2. Matt Williams

    Matt Williams WordPress Fanatic

    497
    96
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +143
    Local Time:
    12:09 AM
    latest
    10
    I'll try it again and post the original vhost
     
  3. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    i just updated 123.09beta01 so if you have setup centmin.sh menu option 23 submenu 1, you can update 123.09beta01 by using centmin.sh menu option 23 submenu 2 :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Just tested latest version of centmin.sh menu option 22 on 123.09beta01 works fine
    Code (Text):
    curl -s http://domain1.com | grep 'Cache Enabler'
    <!-- Cache Enabler by KeyCDN @ 02.12.2015 23:48:00 (html) -->


    Code:
    -------------------------------------------------------------
    Current vhost listing at: /usr/local/nginx/conf/conf.d/
    
                         
    Nov 28  11:55   845    ssl.conf
    Nov 28  11:55   1.1K   demodomain.com.conf
    Nov 28  11:55   1.6K   virtual.conf
    Dec 2   23:47   2.8K   domain1.com.conf
    Dec 2   23:47   5.0K   domain1.com.ssl.conf
    
    -------------------------------------------------------------
    Current vhost ssl files listing at: /usr/local/nginx/conf/ssl/domain1.com
    
                         
    Dec 2   23:44   1.7K   domain1.com.key
    Dec 2   23:44   1.1K   domain1.com.csr
    Dec 2   23:44   1.3K   domain1.com.crt
    Dec 2   23:44   1.7K   domain1.com-backup.key
    Dec 2   23:44   1.1K   domain1.com-backup.csr
    Dec 2   23:44   45     hpkp-info-primary-pin.txt
    Dec 2   23:44   45     hpkp-info-secondary-pin.txt
    Dec 2   23:46   424    dhparam.pem
    
    ------------------------------------------------------------
    To complete setup:
    1. Enable Permalinks (DO NOT use links with .html extensions for performance reasons) i.e. /%post_id%/%postname%/
    2. Settings Menu > Cache Enabler set options and hit Save Changes
    3. Settings Menu > Optimus set options and hit Save Changes
    4. Appearance > Theme Options (Responsive theme) > Home Page nav bar > Uncheck Overrides Wordpress front page option
    vhost contents for /usr/local/nginx/conf/conf.d/domain1.com.conf
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain1.com;
    #            return 301 $scheme://www.domain1.com$request_uri;
    #       }
    
    server {
      server_name domain1.com www.domain1.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain1.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/domain1.com/log/error.log;
    
      root /home/nginx/domains/domain1.com/public;
    
      # prevent access to ./directories and files
      location ~ (?:^|/)\. {
       deny all;
      }
    
    include /usr/local/nginx/conf/wpcacheenabler_domain1.com.conf;
    #include /usr/local/nginx/conf/wpsupercache_domain1.com.conf;
    # https://community.centminmod.com/posts/18828/
    #include /usr/local/nginx/conf/rediscache_domain1.com.conf; 
    
      location / {
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args; 
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/domain1.com/htpasswd_wplogin;   
        include /usr/local/nginx/conf/php-wpsc.conf;
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpsecure_domain1.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    497
    96
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +143
    Local Time:
    12:09 AM
    latest
    10
    I think im going to upgrade all of my VPS's - the new commits are pretty awesome in the beta vs stable
    Upgrading from stable to beta, will it overwrite the php RC8 and install the default 5.6.14 or leave it as RC8? also, will the sites vhost change to the beta? - The beta has allot more vs the stable.

    Installed a new setup - this is the original vhost which I chose to install cache enabler and not wp super cache. Sorry, can't copy the whole vhost file.

     
  6. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Give it a good test :)

    Upgrading Centmin Mod Code to Latest Version



    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS 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.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at Upgrade - How to upgrade Centmin Mod | Centmin Mod Community
    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.

    So nginx and php aren't touched unless you run centmin.sh menu options 4 and 5 respectively after 123.09beta01 update

    as to your bugs, try_files was fixed as you see your copy with prior bug hadn't escaped the variables so ended up blank

    as to include file not idea why then didn't uncomment as i haven't touched that part in above working domain1.com test
     
    Last edited: Dec 3, 2015
  7. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    To verify Cache Enabler works as expected,
    /public/blog/wp-content/cache/cache-enabler/host/blog/post-uri/
    must have this content right?
    [​IMG]
     
  8. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    curl is your friend :)

     
  9. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    Yes, I have it :)
     
  10. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    That was very easy compare to WPSC :D.
     
  11. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yeah that's why i added optional support for WP Cache Enabler to Centmin Mod 123.09beta01 branch for centmin.sh menu option 22 :)
     
  12. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    I have this WP blog already installed under /blog/ sub directory.
    And this is what I have now:
    Code:
    server {
        server_name www.domain.com;
    
        root /home/nginx/domains/domain.com/public;
       
        ### Start Xenforo
        location / {
        index index.php index.html index.htm;
        try_files $uri $uri/ /index.php?$uri&$args;
        }      
        ....
        ...
        ..
        .
        ### End Xenforo
        ###############
    
    
        ############
        ### WP Blog
    
        include /usr/local/nginx/conf/wpcache_enabler.conf;
    
        location /blog {
           
            ### cache enabler plugin
              try_files $cache_enabler_uri $uri $uri/ /blog/index.php?$args;
             
        }
    
        location ~* /blog/(wp-login\.php) {
            include /usr/local/nginx/conf/php.conf;
            auth_basic "Private";
            auth_basic_user_file /usr/local/nginx/conf/htpasswd;
        }
       
        ### End WP Blog
        ###############
    
        include /usr/local/nginx/conf/wpsecure.conf;
        include /usr/local/nginx/conf/staticfiles.conf;
        include /usr/local/nginx/conf/php.conf;
        include /usr/local/nginx/conf/drop.conf;
    
        }
    
    Is that correct? :)
     
  13. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    probably better to have include file within /blog context match

    and maybe wpsecure.conf include too
    Code:
        location /blog {
              include /usr/local/nginx/conf/wpcache_enabler.conf;
              include /usr/local/nginx/conf/wpsecure.conf;
            ### cache enabler plugin
              try_files $cache_enabler_uri $uri $uri/ /blog/index.php?$args;
           
        }
     
  14. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    When I do that, posted articles stop working.
     
  15. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    in wpcache_enabled.conf you'd need to set the subdirectory
    Code:
        # custom sub directory e.g. /blog
        set $custom_subdir '';
    as it gets accounted for when looking up cached versions
    Code:
        # custom sub directory e.g. /blog
        set $custom_subdir '';
    
        # default html file
        set $cache_enabler_uri '${custom_subdir}/wp-content/cache/cache-enabler/${http_host}${cache_uri}index.html';
    
        # webp html file
        if ($http_accept ~* "image/webp") {
            set $cache_enabler_uri '${custom_subdir}/wp-content/cache/cache-enabler/${http_host}${cache_uri}index-webp.html';
        }
    and when using try_files
    Code:
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
     
  16. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    Yes I have "/blog" already set on that file, still 404 page for article pages.
     
  17. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    guess with that set you can move include /usr/local/nginx/conf/wpcache_enabler.conf; back out to the server context instead of /blog context as
    Code:
    set $custom_subdir '/blog';
    tells cache enabler where to look
     
  18. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    Yes, I moved it back on top of /blog location and works fine.
     
  19. rdan

    rdan Well-Known Member

    5,077
    1,255
    113
    May 25, 2014
    Ratings:
    +1,908
    Local Time:
    12:09 PM
    Mainline
    10.2
    I think this addon should be the standard for us now :) , instead of WPSC (complicated one).
     
  20. eva2000

    eva2000 Administrator Staff Member

    47,294
    10,705
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,631
    Local Time:
    2:09 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    well more folks are familiar with WP Super Cache so left it as a choice for folks :)