Learn about Centmin Mod LEMP Stack today
Become a Member

WP Setup menu 22 has issues

Discussion in 'Bug Reports' started by rdan, Sep 15, 2015.

  1. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    Code:
    Enter option [ 1 - 24 ] 22
    --------------------------------------------------------
    ------------------------------------------------------------
    Installing wpcli.sh
    ------------------------------------------------------------
    installing...
    
    Error: /usr/bin/wp not found !!! Downloading now......
    2015-09-15 13:52:16 URL:https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar [1386662/1386662] -> "/usr/bin/wp" [1]
    Download done.
    
    Error: /root/wpcli/wp-completion.bash not found !!! Downloading now......
    2015-09-15 13:52:18 URL:https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash [495/495] -> "/root/wpcli/wp-completion.bash" [1]
    Download done.
    
    
    -------------------------------------------------------------
    PHP binary:    /usr/local/bin/php
    PHP version:    7.0.0RC2
    php.ini used:    /usr/local/lib/php.ini
    WP-CLI root dir:    phar://wp-cli.phar
    WP-CLI global config:  
    WP-CLI project config:  
    WP-CLI version:    0.20.0
    -------------------------------------------------------------
    
    -------------------------------------------------------------
    wp-cli install completed
    Read http://wp-cli.org/ for full usage info
    
    -------------------------------------------------------------
    Please log out of SSH session and log back in
    You can then call wp-cli via command: wp
    i.e. wp --info --allow-root
    -------------------------------------------------------------
    
    -------------------------------------------------------------
    Setup full Nginx vhost + Wordpress + WP Super Cache
    -------------------------------------------------------------
    
    Enter vhost domain name you want to add (without www. prefix): domain.com
    Enter email address for Wordpress Installation: xxxxxxxxx@gmail.com
    
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    /usr/local/nginx/conf/htpasswd.sh create /home/nginx/domains/domain.com/htpasswd_wplogin XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    
    /home/nginx/domains/domain.com/htpasswd_wplogin contents:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
    ------------------------------------------------------------
    Setup Wordpress + Super Cache for domain.com
    ------------------------------------------------------------
    Warning: The `wp core download` command has an invalid synopsis part: [--force]
    Downloading WordPress 4.3 (en_US)...
    Success: WordPress downloaded.
    Warning: The `wp core config` command has an invalid synopsis part: [--extra-php]
    Warning: The `wp core config` command has an invalid synopsis part: [--skip-salts]
    Warning: The `wp core config` command has an invalid synopsis part: [--skip-check]
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    sed: can't read wp-config.php: No such file or directory
    sed: can't read wp-config.php: No such file or directory
    0 */4 * * * /usr/bin/cminfo_updater
    */5 * * * * /bin/chown -R nginx:nginx /home/nginx/domains/
    1 */6 * * * /bin/chown -R nginx:nginx /usr/local/nginx/html/
    */15 * * * * sleep 251s ; wget -O - -q -t 1 http://domain.com/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    
    Error: wp-config.php not found.
    Either create one manually or use `wp core config`.
    ------------------------------------------------------------
    chmod: cannot access ‘wp-content/plugins/tpc-memory-usage/logs/tpcmem.log’: No such file or directory
    sed: can't read wp-content/plugins/tpc-memory-usage/css/tpcmem.css: No such file or directory
    cp: cannot stat ‘wp-content/plugins/wp-super-cache/wp-cache-config-sample.php’: No such file or directory
    cp: cannot stat ‘wp-content/plugins/wp-super-cache/advanced-cache.php’: No such file or directory
    ------------------------------------------------------------
    Created uninstall script
    /root/tools/wp_uninstall_domain.com.sh
    ------------------------------------------------------------
    ------------------------------------------------------------
    Created wp_updater_domain.com.sh script
    /root/tools/wp_updater_domain.com.sh
    ------------------------------------------------------------
    0 */4 * * * /usr/bin/cminfo_updater
    */5 * * * * /bin/chown -R nginx:nginx /home/nginx/domains/
    1 */6 * * * /bin/chown -R nginx:nginx /usr/local/nginx/html/
    */15 * * * * sleep 251s ; wget -O - -q -t 1 http://domain.com/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1
    0 */8 * * * sleep 227s ;/root/tools/wp_updater_domain.com.sh 2>/dev/null
    
    -------------------------------------------------------------
    service nginx reload
    Reloading nginx configuration (via systemctl):  Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
    [FAILED]
    
    -------------------------------------------------------------
    vhost for domain.com created successfully
    
    domain: http://domain.com
    vhost conf file for domain.com created: /usr/local/nginx/conf/conf.d/domain.com.conf
    
    upload files to /home/nginx/domains/domain.com/public
    vhost log files directory is /home/nginx/domains/domain.com/log
    
    ------------------------------------------------------------
    SSH commands to uninstall created Wordpress install and Nginx vhost:
      /root/tools/wp_uninstall_domain.com.sh
    ------------------------------------------------------------
    
    ------------------------------------------------------------
    Wordpress Auto Updater created at:
      /root/tools/wp_updater_domain.com.sh
    cronjob set for every 8 hours update (3x times per day)
    ------------------------------------------------------------
    
    Wordpress domain: domain.com
    Wordpress DB Name: wp30062db_803
    Wordpress DB User: xxxx
    Wordpress DB Pass: xxxxx
    Wordpress Admin User ID: 143554
    Wordpress Admin User: xxxxx
    Wordpress Admin Pass: xxxx
    Wordpress Admin Email: nadlexxxx@gmail.com
    
    Wordpress wp-login.php password protection info:
    wp-login.php protection file /home/nginx/domains/domain.com/htpasswd_wplogin
    wp-login.php protection Username: u6kRegJQIrK+AOx31868
    wp-login.php protection Password: p+ug9e3jh9gg+SART8gQy31868
    http://u6kRegJQIrK+AOx31868:p+ug9e3jh9gg+SART8gQy31868@domain.com/wp-login.php
    
    Resetting wp-login.php protection:
    Step 1. remove protection file at /home/nginx/domains/domain.com/htpasswd_wplogin
         rm -rf /home/nginx/domains/domain.com/htpasswd_wplogin
    Step 2. run command:
         /usr/local/nginx/conf/htpasswd.sh create /home/nginx/domains/domain.com/htpasswd_wplogin YOURUSERNAME YOURPASSWORD
    Step 3. restart Nginx + PHP-FPM services
         nprestart
    
    -------------------------------------------------------------
    Current vhost listing at: /usr/local/nginx/conf/conf.d/
    
                         
    Sep 15  13:43   654    virtual.conf
    Sep 15  13:52   2.0K   domain.com.conf
    
    ------------------------------------------------------------
    To complete setup:
    1. Enable Permalinks (DO NOT use links with .html extensions for performance reasons) i.e. /%post_id%/%postname%/
    2. Settings Menu > Super Cache > Easy tab and enable it by checking Caching On (Recommended) and hit Update Status
    3. Advanced tab & check Use mod_rewrite serve cache files & Don’t cache pages with GET parameters and Known User.
       (Recommended) & hit Update Status
    4. WP Security Menu > Settings > Check All except Enable Live Traffic tool and hit Update settings
    5. Settings Menu > Updates Notifier and setup your notify email address and cronjob (save and test button to check)
    6. Settings Mnenu > Autoptimize and check Optimize HTML, JavaScript and CSS options (show advanced settings)
    7. Settings Menu > Limit Login Attempts and configure as desired or leave as defaults
    8. Sucuri Security Menu and top left click Generate API key for your domain/email and configure your Settings tab
    9. WP-Optimize Menu and configure as needed
    10. Memory Usage Menu > Settings and adjust accordingly
    11. GTmetrix Menu > setup and register your GTmetrix Account and API Key
    12. go-newrelic plugin installed but not activated read https://wordpress.org/plugins/go-newrelic/installation/
    13. Tools > P3 Plugin Profiler > Start Scan to profile all your plugins
    14. Plugins > Query Monitor is disabled by default, enable to check MySQL query stats
    15. Plugins > DB Cache Reloaded disabled by default unsure if works with Wordpress 4.x ?
    16. Appearance > Theme Options (Responsive theme) > Home Page nav bar > Uncheck Overrides Wordpress front page option
    17. Seo Menu (Yoast SEO) > configure accordingly
    18. Settings > UpdraftPlus Backups > Settings set file/database backup intervals & optional backup to remote storage
    19. Analytics > Settings > configure your Google Analytics UA Code
    ------------------------------------------------------------
    
    I have disabled Mysql/Memcached intentionally.

     
  2. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    seems you're not able to connect to mysql server

    Code:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    which is where the problem is as wp-cli will need mysql connection to create the mysql database for wordpress install

    if you disable mysql server and stop it, then centmin.sh option 22 will not work as wp-cli needs to connect to mysql server
     
  3. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    And I notice generated vhost config missing some important include, like:
    include /usr/local/nginx/conf/wpsupercache_xxxxxxx.conf;
     
  4. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    staticfile.conf should be included/declared before php.conf.
    It's declared/include after php.conf on the generated vhost.
     
  5. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    can you post the contents of the generated /usr/local/nginx/conf/wpsupercache_xxxxxxx.conf and vhost
     
  6. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    Opz, I already modified it :(
    Code:
    set $cache_uri $request_uri;
    
    if ($request_method = POST) { set $cache_uri 'null cache'; }
    
    if ($query_string != "") { set $cache_uri 'null cache'; }
    
    if ($request_uri ~* "/(\?add-to-cart=|cart|my-account|checkout|addons|wp-admin/.*|xmlrpc\.php|wp-.*\.php|index\.php|feed/|sitemap(_index)?\.xml|[a-z0-9_-]+-sitemap([0-9]+)?\.xml)") { set $cache_uri 'null cache'; }
    
    if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { set $cache_uri 'null cache'; }
    Code is fine, but this file is not included on the vhost config.
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  8. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    just tested this myself and works as expected my vhost config contents for /usr/local/nginx/conf/conf.d/newdomain.com.conf

    the include file for /usr/local/nginx/conf/wpsupercache_newdomain.com.conf is above location /


    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 newdomain.com;
    #            return 301 $scheme://www.newdomain.com$request_uri;
    #       }
    
    server {
      server_name newdomain.com www.newdomain.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/newdomain.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/newdomain.com/log/error.log;
    
      root /home/nginx/domains/newdomain.com/public;
    
      # prevent access to ./directories and files
      location ~ (?:^|/)\. {
       deny all;
      }
    
    include /usr/local/nginx/conf/wpsupercache_newdomain.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;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$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/newdomain.com/htpasswd_wplogin;  
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwplogin burst=2 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
      include /usr/local/nginx/conf/wpsecure_newdomain.com.conf;
      include /usr/local/nginx/conf/php-wpsc.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;
    }
     
  9. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    I will not enable html permalinks :).
    So I put it back above php.conf, so static files will not trigger php-fpm.
     
  10. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    Don't know why it screw up on mine.
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    well that's end user choice, unfortunately only a small majority of centmin mod users frequent this forum so don't know that html permalink extensions get caught in staticfiles.conf location matches
     
  12. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    run uninstall script for /root/tools/wp_uninstall_yourdomain.com.sh to remove the existing install and try again

    ensure you have latest centmin mod code too just to be safe
     
  13. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    I also remove that .html location for my taigachat to work.
     
  14. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    8:49 PM
    Mainline
    10.2
    I'm always on the new codes :).
     
  15. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+