Discover Centmin Mod today
Register Now

Wordpress I get error amp link from google search

Discussion in 'Blogs & CMS usage' started by congthanh, Oct 25, 2018.

  1. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    Dear sir,
    I'm using wordpress, on google search show error link amp.

    thank you

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    need more details and specific errors you get

    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
    • How was wordpress installed ?
     
  3. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    CentOS Version CentOS Linux release 7.5.1804 (Core) 64Bit
    Centmin Mod Version Installed: i.e. 123.08stable
    Nginx Version Installed: nginx/1.15.2
    PHP Version Installed: PHP 5.6.38 (cli) (built: Oct 6 2018 12:19:43)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
    MariaDB MySQL Version Installed: 10.0.36-MariaDB MariaDB Server

    I don't have "Persistent Config"

    [​IMG]
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you need to validate your amp page format as wordpress plugins maybe not be fully amp validated so nothing to do with centmin mod itself.

    contact wordpress plugin for amp author
     
  5. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    Dear Eva2000,

    I run two website
    a website i'm using hosting. It's Okay
    another website i use centminmod on vps and i get this error :((
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    does google allow you to click those error reported urls for more details, use amp validator to check those urls either way sometimes wp styles/plugins insert non-amp validated code into amp pages.
     
  7. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    Dear eva2000,
    [​IMG]


    [​IMG]
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    I'm using tagDiv AMP :(
     
    Last edited: Oct 26, 2018
  10. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes means either your wp style or wp plugin has used that tag which may not be valid for AMP pages
     
  11. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    Dear Eva2000,

    I record my video about i use tagDiv AMP plugin on two website.
    1. on hosting it's okie.
    2. On Centos use Centminmod have error



    Thank you
     
  12. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    but using different styles/data ?? or same site/data/style ?

    Centmin Mod values security and puts additional measures in place so that end users are also mindful of security. So in your case, you might need to whitelist or unblock the WP plugins related to your 403 permission denied messages.

    If you used centmin.sh menu option 22 auto installer Wordpress Nginx Auto Installer, the default wpsecure conf file at /usr/local/nginx/conf/wpincludes/${vhostname}/wpsecure_${vhostname}.conf where vhostname is your domain name, blocks php scripts from executing in wp-content for security

    Below links you can see examples of setting up specific wordpress location matches to punch a hole in the wpsecure blocking to whitelist specific php files that need to be able to run.

    If on Centmin Mod 123.09beta01, you may have ran into the new tools/autoprotect.sh cronjob feature outlined at Beta Branch - autoprotect.sh - apache .htaccess check & migration to nginx deny all | Centmin Mod Community You uploaded scripts may have .htaccess deny from all type files in their directories which may need bypassing autoprotect. It's a security feature that no other nginx based stack has as far as I know :)

    So instead, all .htaccess 'deny from all' detected directories now get auto generated Nginx equivalent location match and deny all setups except if you want to manually bypass the directory from auto protection via a .autoprotect-bypass file - details below here.

    You can read a few threads below on how autoprotect.sh may have caught some folks web apps falsely and the workarounds or improvements made to autoprotect.sh with the help of users feedback and troubleshooting.
    Check if your nginx vhost at either or both /usr/local/nginx/conf/conf.d/domain.com.conf and/or /usr/local/nginx/conf/conf.d/domain.com.ssl.conf has include file for autoprotect example
    Code (Text):
    include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
    

    see if your directory for the script which has issues is caught in an autoprotect include entry in /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf which has a deny all entry
    Code (Text):
    cat /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf
    

    i.e.
    Code (Text):
    # /home/nginx/domains/domain.com/public/subdirectory/js
    location ~* ^/subdirectory/js/ { allow 127.0.0.1; deny all; }
    

    If caught you can whitelist it by autoprotect bypass .autoprotect-bypass file - details below here. So if problem js file is at domain.com/subdirectory/js/file.js then it is likely /subdirectory/js has a .htaccess with deny all in it - make sure that directory is meant to be publicly accessible by contacting author of script and if so, you can whitelist it and re-run autoprotect script to regenerate your /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file
    Code (Text):
    cd /home/nginx/domains/domain.com/public/subdirectory/js
    touch .autoprotect-bypass
    /usr/local/src/centminmod/tools/autoprotect.sh
    nprestart
    

    it maybe you need to also whitelist /subdirectory then it would be as follows creating bypass files at /home/nginx/domains/domain.com/public/subdirectory/.autoprotect-bypass and /home/nginx/domains/domain.com/public/subdirectory/js/.autoprotect-bypass
    Code (Text):
    cd /home/nginx/domains/domain.com/public/subdirectory/
    touch .autoprotect-bypass
    cd /home/nginx/domains/domain.com/public/subdirectory/js
    touch .autoprotect-bypass
    /usr/local/src/centminmod/tools/autoprotect.sh
    nprestart
    

    then double check to see if updated /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file now doesn't show an entry for /subdirectory/js
     
  13. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    i'm using same style.

    Code:
    location ~ ^/wp-content/plugins/td-amp/ {
      include /usr/local/nginx/conf/php.conf;
    }
    I added whitelist for AMP but same old.

    Thank you
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    where did you add that in /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file ?

    what's contents of /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file ?

    or did you add to /usr/local/nginx/conf/wpincludes/${vhostname}/wpsecure_${vhostname}.conf ? and contents of that ?

    make sure to restart both nginx and php-fpm
    Code (Text):
    nprestart
    
     
  15. congthanh

    congthanh New Member

    28
    0
    1
    Oct 25, 2018
    Ratings:
    +0
    Local Time:
    4:18 PM
    1.13
    I don't have file autoprotect.

    My content in wpsecure_${vhostname}.conf
    Code:
    # prevent .zip, .gz, .tar, .bzip2 files from being accessed by default
    # impossible for centmin mod to know which wp backup plugins they installed
    # which may save backups to directories in wp-content/
    # such plugins may deploy .htaccess protection but that isn't supported installed
    # nginx, so blocking access to these extensions is a workaround to cover all bases
    location ~* ^/(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z)$ { deny all; }
    
    # Deny access to any files with a .php extension in the uploads directory
    # Works in sub-directory installs and also in multisite network
    location ~ ^/wp-content/updraft { deny all; }
    
    location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/theme-check/
    location ~ ^/wp-content/plugins/theme-check/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    location ~ ^/(wp-includes/js/tinymce/) {
            include /usr/local/nginx/conf/php.conf;
    }
    
    location ~ ^/wp-content/plugins/td-amp/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    location ~ ^/(wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/) {
            include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/woocommerce/
    location ~ ^/wp-content/plugins/woocommerce/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/woocommerce-csvimport/
    location ~ ^/wp-content/plugins/woocommerce-csvimport/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/advanced-custom-fields/
    location ~ ^/wp-content/plugins/advanced-custom-fields/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/contact-form-7/
    location ~ ^/wp-content/plugins/contact-form-7/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/duplicator/
    location ~ ^/wp-content/plugins/duplicator/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/jetpack/
    location ~ ^/wp-content/plugins/jetpack/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/nextgen-gallery/
    location ~ ^/wp-content/plugins/nextgen-gallery/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/tinymce-advanced/
    location ~ ^/wp-content/plugins/tinymce-advanced/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/updraftplus/
    location ~ ^/wp-content/plugins/updraftplus/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordpress-importer/
    location ~ ^/wp-content/plugins/wordpress-importer/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordpress-seo/
    location ~ ^/wp-content/plugins/wordpress-seo/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wpclef/
    location ~ ^/wp-content/plugins/wpclef/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/mailchimp-for-wp/
    location ~ ^/wp-content/plugins/mailchimp-for-wp/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-optimize/
    location ~ ^/wp-content/plugins/wp-optimize/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/si-contact-form/
    location ~ ^/wp-content/plugins/si-contact-form/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/akismet/
    location ~ ^/wp-content/plugins/akismet/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/bbpress/
    location ~ ^/wp-content/plugins/bbpress/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/buddypress/
    location ~ ^/wp-content/plugins/buddypress/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/all-in-one-seo-pack/
    location ~ ^/wp-content/plugins/all-in-one-seo-pack/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/google-analytics-for-wordpress/
    location ~ ^/wp-content/plugins/google-analytics-for-wordpress/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/regenerate-thumbnails/
    location ~ ^/wp-content/plugins/regenerate-thumbnails/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-pagenavi/
    location ~ ^/wp-content/plugins/wp-pagenavi/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordfence/
    location ~ ^/wp-content/plugins/wordfence/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/really-simple-captcha/
    location ~ ^/wp-content/plugins/really-simple-captcha/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-pagenavi/
    location ~ ^/wp-content/plugins/wp-pagenavi/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/ml-slider/
    location ~ ^/wp-content/plugins/ml-slider/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/black-studio-tinymce-widget/
    location ~ ^/wp-content/plugins/black-studio-tinymce-widget/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/disable-comments/
    location ~ ^/wp-content/plugins/disable-comments/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/better-wp-security/
    location ~ ^/wp-content/plugins/better-wp-security/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    
    # Whitelist Exception for http://wlmsocial.com/
    location ~ ^/wp-content/plugins/wlm-social/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Whitelist Exception for mediagrid timthumb
    location ~ ^/wp-content/plugins/media-grid/classes/ {
      include /usr/local/nginx/conf/php.conf;
    }
    
    # Block PHP files in content directory.
    location ~* /wp-content/.*\.php$ {
      deny all;
    }
    
    # Block PHP files in includes directory.
    location ~* /wp-includes/.*\.php$ {
      deny all;
    }
    
    # Block PHP files in uploads, content, and includes directory.
    location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php$ {
      deny all;
    }
    
    # Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
    location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_
    {
    return 444;
    }
    
    #nocgi
    location ~* \.(pl|cgi|py|sh|lua)$ {
    return 444;
    }
    
    #disallow
    location ~* (w00tw00t) {
    return 444;
    }
    
    location ~* /(\.|wp-config\.php|wp-config\.txt|changelog\.txt|readme\.txt|readme\.html|license\.txt) { deny all; }
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+