Learn about Centmin Mod LEMP Stack today
Register Now

Wordpress Problems with login page

Discussion in 'Blogs & CMS usage' started by MrKoro, Jan 28, 2018.

  1. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    Hello!

    I am wondering if anyone on here could help me with a problem I have with a freshly installed Wordpress.

    When I try to login to my admin Dashboard for the first time the page just refreshes. Without displaying any error/success message.

    I tried to search around for a fix but none of them worked (clear cookies, add two lines of code to wp-config.php, Edit databases, replacing wp-admin & wp-includes, disable plugins by renaming the plugin folder etc.)

    I am now stuck with no solution in view. So I will be very grateful if anyone here could help me out!

    I am running 123.09beta01 on CentOS 7 64bit.

    Any settings haven't been changed. What this means is that I run centmin.sh option 22 right away after Centmin Mod is installed. And I have also rebooted my server.

    My VPS ($5) is hosted by Linode.

    If needed, I can record my screen for you guys to understand the problem better.

    Thank you so much!
     
  2. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    Do you have any front end reverse proxies like cloudflare or sucuri cloudproxy in use ?

    Are you use HTTPS SSL based wordpress or non-HTTPS wordpress ?

    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)

    what is output of these commands in ssh
    Code (Text):
    curl -I https://domain.com
    

    Code (Text):
    curl -I https://www.domain.com
    

    Code (Text):
    curl -I http://domain.com
    

    Code (Text):
    curl -I http://www.domain.com
    

    wrap output in CODE tags
     
  3. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    Thank you for the fast reply!

    I do use Cloudflare and their HTTPS SSL service.

    Here are the outputs you requested:

    Code:
    /usr/local/nginx/conf/conf.d/mydomain.com.conf
    
    # 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 mydomain.com;
    #            return 301 $scheme://www.mydomain.com$request_uri;
    #       }
    
    server {
    
      server_name mydomain.com www.mydomain.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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/mydomain.com/log/access.log combined buffer=256k flush=5m;
    error_log /home/nginx/domains/mydomain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/mydomain.com/autoprotect-mydomain.com.conf;
      root /home/nginx/domains/mydomain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      include /usr/local/nginx/conf/wpincludes/mydomain.com/wpcacheenabler_mydomain.com.conf;
      #include /usr/local/nginx/conf/wpincludes/mydomain.com/wpsupercache_mydomain.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/mydomain.com/rediscache_mydomain.com.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    
      # 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=$
    
      # 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/mydomain.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/wpincludes/mydomain.com/wpsecure_mydomain.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/wpincludes/mydomain.com/wpsecure_mydomain.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;
    }
    
    
    
    
    Code:
    curl -I https://domain.com
    
    HTTP/1.1 200 OK
    Date: Sun, 28 Jan 2018 14:15:27 GMT
    Content-Type: text/html; charset=utf-8
    Connection: keep-alive
    Set-Cookie: __cfduid=dc0093afa642cafdd0d52d9905d5e6f7c1517148927; expires=Mon, 28-Jan-19 14:15:27 GMT; path=/; domain=.mydomain.com; HttpOnly; Secure
    Last-Modified: Sun, 28 Jan 2018 12:09:37 GMT
    Vary: Accept-Encoding
    X-Powered-By: centminmod
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Server: cloudflare
    CF-RAY: 3e44905ea97634ac-LHR
    
    Code:
    curl -I https://www.mydomain.com:
    
    HTTP/1.1 301 Moved Permanently
    Date: Sun, 28 Jan 2018 14:23:57 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=d1942dc7859192e6dfd9b7c4ac9267d321517149437; expires=Mon, 28-Jan-19 14:23:57 GMT; path=/; domain=.mydomain.com; HttpOnly; Secure
    Location: http://mydomain.com/
    X-Powered-By: centminmod
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Server: cloudflare
    CF-RAY: 3e449cd0f81a357e-LHR
    
    Code:
    curl -I http://mydomain.com:
    
    HTTP/1.1 301 Moved Permanently
    Date: Sun, 28 Jan 2018 14:25:48 GMT
    Connection: keep-alive
    Cache-Control: max-age=3600
    Expires: Sun, 28 Jan 2018 15:25:48 GMT
    Location: https://mydomain.com/
    Server: cloudflare
    CF-RAY: 3e449f84361034b8-LHR
    
    Code:
    curl -I http://www.mydomain.com:
    
    HTTP/1.1 301 Moved Permanently
    Date: Sun, 28 Jan 2018 14:27:24 GMT
    Connection: keep-alive
    Cache-Control: max-age=3600
    Expires: Sun, 28 Jan 2018 15:27:24 GMT
    Location: https://www.mydomain.com/
    Server: cloudflare
    CF-RAY: 3e44a1dcd77535a8-LHR
    
    I edited out my domain name for privacy reasons and replaced it with mydomain.com

    Again, thank you very much! :)
     
    Last edited: Jan 29, 2018
  4. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    which is your main domain redirect for as this one is forcing a redirect loop from HTTPS www to non-www non-HTTPS
    Code (Text):
    curl -I https://www.mydomain.com:
    
    HTTP/1.1 301 Moved Permanently
    Date: Sun, 28 Jan 2018 14:23:57 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=d1942dc7859192e6dfd9b7c4ac9267d321517149437; expires=Mon, 28-Jan-19 14:23:57 GMT; path=/; domain=.mydomain.com; HttpOnly; Secure
    Location: http://mydomain.com/
    X-Powered-By: centminmod
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Server: cloudflare
    CF-RAY: 3e449cd0f81a357e-LHR
    


    If you have Centmin Mod Nginx with letsencrypt HTTPS vhost setup, then switch from cloudflare flexible ssl to full ssl and remove Cloudflare wordpress plugin and remove nginx vhost level redirect 301/302 redirects for http to https. If you do not have letsencrypt HTTPS on Centmin Mod Nginx vhost, then set cloudflare to flexible ssl and install cloudflare wordpress plugin and remove nginx vhost level redirect 301/302 redirects for http to https.

    Unrelated to your issue is if you use a reverse proxy like Cloudflare, Sucuri, or Incapsula in front of Centmin Mod Nginx, you need to setup nginx realip to be passed onto Nginx.

    See Getting Started Guide step 5 and setting correct real ip via nginx module config at http://centminmod.com/nginx_configure_cloudflare.html.

    If using Centmin Mod 123.09beta01 and newer, there's an added tools/csfcf.sh script to aid in this. Details at:
    You just need to setup a cronjob to run
    Code (Text):
    /usr/local/src/centminmod/tools/csfcf.sh auto

    and ensure your nginx.conf http{} context has the include file /usr/local/nginx/conf/cloudflare.conf and/or your individual nginx vhost's server contexts has the same include file
    Code (Text):
    http {
    map_hash_bucket_size 128;
    map_hash_max_size 2048;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size 2048;
    
    limit_req_zone $binary_remote_addr zone=xwplogin:16m rate=40r/m;
    #limit_conn_zone $binary_remote_addr zone=xwpconlimit:16m;
    
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    
    include /usr/local/nginx/conf/cloudflare.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    include /usr/local/nginx/conf/vts_http.conf;
    include /usr/local/nginx/conf/geoip.conf;
    #include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;

    Then restart nginx server via command shortcut
    Code (Text):
    ngxrestart

    or
    Code (Text):
    service nginx restart
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    /usr/local/nginx/conf/conf.d/mydomain.com.conf file is missing alot of output actually
    Code (Text):
    cat /usr/local/nginx/conf/conf.d/mydomain.com.conf
    

    will show it all
     
  6. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    Yep, I noticed that. Just edited my 2nd post.
     
  7. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    so you only have non-https nginx vhost so highlighted quoted part applies
     
  8. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    Can you please tell me how to do this?
     
  9. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    no need your mydomain.com.conf vhost already has them commented out
    Code (Text):
    # 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 mydomain.com;
    #            return 301 $scheme://www.mydomain.com$request_uri;
    #       }
    

    it's usually a step users manually do as per centminmod.com/nginx_domain_dns_setup.html#httpsredirect
     
  10. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    Hello again.

    I am still having the same problem after I followed your instructions. Do you have any more idea how this problem can be solved?

    Here is how it looks like (.gif) :

    [​IMG]
     
  11. eva2000

    eva2000 Administrator Staff Member

    32,247
    7,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,892
    Local Time:
    3:47 PM
    Nginx 1.13.x
    MariaDB 5.5
    did you install and configure wordpress cloudflare plugin previously Using Cloudflare with WordPress ?

    try disabling cloudflare orange cloud on your wordpress domain temporarily and see if it works
     
  12. MrKoro

    MrKoro New Member

    7
    1
    3
    Jan 28, 2018
    Ratings:
    +1
    Local Time:
    6:47 AM
    1.13.8
    I did manually install the plugin via FTP but couldn't configure it. (No access to the dashboard. But now I will try.) And I could login after I disabled Cloudflare orange cloud. How do I move forward after this to fix the underlying problem?

    Thank you for all the help! Phenomenal support :)