Join the community today
Register Now

reboot trouble

Discussion in 'Blogs & CMS usage' started by emre22, Dec 21, 2016.

  1. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    Hey,

    after a yum update, my site is redirected to the demo page. I tried restarting mysql, php, nginx but still the same. (stable cmm)

    The folder still exist at the right place. How can I solve it?

    thank you in advance.
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    what does your /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/yourdomain.com.conf contents look like ? Make sure virtual.conf main hostname's server_name isn't same as any added nginx vhost site's domain name as per Getting Started Guide step 1, the main hostname needs to be unique.

    Also when was the last time you updated centmin mod 123.08stable via centmin.sh menu option 23 submenu option 2?

    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:
     
    • Like Like x 1
  3. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    virtual.conf:
    PHP:
    server {
    #         listen   80;
                
    listen   80 default_server backlog=2048;
                
    server_name cmm;
                
    root   html;

            
    access_log              /var/log/nginx/localhost.access.log     main buffer=256k flush=5m;
            
    error_log               /var/log/nginx/localhost.error.log      error;

    # 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;

            
    location /nginx_status {
            
    stub_status on;
            
    access_log   off;
            
    allow 127.0.0.1;
            
    #allow youripaddress;
            
    deny all;
            }

                
    location / {

    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;

    #         Enables directory listings when index file not found
    #        autoindex  on;

    #        Shows file listing times as local time
    #        autoindex_localtime on;

    #        Enable for vBulletin usage WITHOUT vbSEO installed
    #        try_files        $uri $uri/ /index.php;
              
                
    }

            
    # example nginx-http-concat
            # /csstest/??one.css,two.css
            #location /csstest {
            #concat on;
            #concat_max_files 20;
            #}

    include /usr/local/nginx/conf/staticfiles.conf;
    include /
    usr/local/nginx/conf/include_opcache.conf;
    include /
    usr/local/nginx/conf/php.conf;
    #include /usr/local/nginx/conf/phpstatus.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    include /usr/local/nginx/conf/vts_mainserver.conf;

           }
     
    Last edited: Dec 21, 2016
  4. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    mydomain.com.conf:

    PHP:
    # Centmin Mod Getting Started Guide
    # must read Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS

    # 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 censored.com;
    #            return 301 $scheme://www.censored.com$request_uri;
    #       }

    server {
      
    server_name censored.com www.censored.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/censored.com/log/access.log combined buffer=256k flush=60m;
      
    error_log /home/nginx/domains/censored.com/log/error.log;

      
    root /home/nginx/domains/censored.com/public;

      include /
    usr/local/nginx/conf/wpsupercache_censored.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/censored.com/htpasswd_wplogin;   
        include /
    usr/local/nginx/conf/php-wpsc.conf;
    }

    location ~* /(xmlrpc\.php) {
        
    limit_req zone=xwprpc burst=45 nodelay;
        
    #limit_conn xwpconlimit 30;
        
    include /usr/local/nginx/conf/php-wpsc.conf;
    }

      include /
    usr/local/nginx/conf/wpsecure_censored.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;
    }
     
    Last edited: Dec 21, 2016
  5. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    23->2:

    No local changes to save
    Already up-to-date.
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    In future, might want to use CODE tags for code How to use forum BBCODE code tags :)

    looks okay to me as i can't see anything at nginx level that would be an issue

    double check your virtual.conf and domain.com.conf server_name listed domain's DNS is correct too

    what's output of command below wrap in CODE tags
    Code (Text):
    yum history list
     
    • Like Like x 1
  7. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    Code:
    # yum history list
    Loaded plugins: fastestmirror, priorities, security
    ID     | Login user               | Date and time    | Action(s)      | Altered
    -------------------------------------------------------------------------------
        25 | root <root>              | 2016-12-20 15:43 | Update         |    1   
        24 | root <root>              | 2016-12-13 20:00 | Update         |    1   
        23 | root <root>              | 2016-12-13 20:00 | Obsoleting     |   10   
        22 | root <root>              | 2016-12-03 23:43 | Update         |    2   
        21 | root <root>              | 2016-11-27 00:00 | Install        |    3   
        20 | root <root>              | 2016-11-26 23:56 | Install        |   12   
        19 | root <root>              | 2016-11-26 23:53 | Install        |    1   
        18 | root <root>              | 2016-11-26 23:53 | Install        |    2   
        17 | root <root>              | 2016-11-26 23:51 | Install        |    4   
        16 | root <root>              | 2016-11-26 23:50 | Install        |    4   
        15 | root <root>              | 2016-11-26 23:41 | Install        |    2   
        14 | root <root>              | 2016-11-26 23:41 | Install        |    4   
        13 | root <root>              | 2016-11-26 23:40 | I, O           |    7 EE
        12 | root <root>              | 2016-11-26 15:35 | Install        |    9   
        11 | root <root>              | 2016-11-26 15:35 | Erase          |    4   
        10 | root <root>              | 2016-11-26 15:35 | Install        |   18  <
         9 | root <root>              | 2016-11-26 15:34 | Install        |    3 >
         8 | root <root>              | 2016-11-26 15:34 | Install        |    5   
         7 | root <root>              | 2016-11-26 15:34 | Install        |    1   
         6 | root <root>              | 2016-11-26 15:34 | Install        |    5   
    history list
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    and outputs for
    Code (Text):
    yum history info 25

    Code (Text):
    yum history info 24

    Code (Text):
    yum history info 23
     
    • Like Like x 1
  9. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    Code:
    # yum history info 25
    Loaded plugins: fastestmirror, priorities, security
    Transaction ID : 25
    Begin time     : Tue Dec 20 15:43:53 2016
    Begin rpmdb    : 684:bd7d3e1ac2fd10be13ba55657d1493c90f4b69f1
    End time       :                           (0 seconds)
    End rpmdb      : 684:3848412f003e2acb1b4d6f629dbf5769cc86af9a
    User           : root <root>
    Return-Code    : Success
    Command Line   : update -y
    Transaction performed with:
        Installed     rpm-4.8.0-55.el6.x86_64                       @anaconda-CentOS-201605220104.x86_64/6.8
        Installed     yum-3.2.29-75.el6.centos.noarch               @updates
        Installed     yum-plugin-fastestmirror-1.1.30-37.el6.noarch @anaconda-CentOS-201605220104.x86_64/6.8
    Packages Altered:
        Updated iftop-1.0-0.7.pre4.el6.x86_64  @epel
        Update        1.0-0.12.pre4.el6.x86_64 @epel
    history info
    
    Code:
    # yum history info 24
    Loaded plugins: fastestmirror, priorities, security
    Transaction ID : 24
    Begin time     : Tue Dec 13 20:00:15 2016
    Begin rpmdb    : 684:6ed088691646be7454a36f11d6644dc58761bf78
    End time       :                           (0 seconds)
    End rpmdb      : 684:bd7d3e1ac2fd10be13ba55657d1493c90f4b69f1
    User           : root <root>
    Return-Code    : Success
    Command Line   : -y update
    Transaction performed with:
        Installed     rpm-4.8.0-55.el6.x86_64                       @anaconda-CentOS-201605220104.x86_64/6.8
        Installed     yum-3.2.29-75.el6.centos.noarch               @updates
        Installed     yum-plugin-fastestmirror-1.1.30-37.el6.noarch @anaconda-CentOS-201605220104.x86_64/6.8
    Packages Altered:
        Updated sudo-1.8.6p3-24.el6.x86_64   @anaconda-CentOS-201605220104.x86_64/6.8
        Update       1.8.6p3-25.el6_8.x86_64 @updates
    history info
    
    Code:
    # yum history info 23
    Loaded plugins: fastestmirror, priorities, security
    Transaction ID : 23
    Begin time     : Tue Dec 13 20:00:10 2016
    Begin rpmdb    : 684:891f4a3f2cce04459244eda1f502edecef299932
    End time       :            20:00:11 2016 (1 seconds)
    End rpmdb      : 684:6ed088691646be7454a36f11d6644dc58761bf78
    User           : root <root>
    Return-Code    : Success
    Command Line   : -y update ImageMagick-last ImageMagick-last-devel ImageMagick-last-c++ ImageMagick-last-c++-devel --enablerepo=remi --disableplugin=priorities
    Transaction performed with:
        Installed     rpm-4.8.0-55.el6.x86_64                       @anaconda-CentOS-201605220104.x86_64/6.8
        Installed     yum-3.2.29-75.el6.centos.noarch               @updates
        Installed     yum-plugin-fastestmirror-1.1.30-37.el6.noarch @anaconda-CentOS-201605220104.x86_64/6.8
    Packages Altered:
        Obsoleted  ImageMagick-last-6.9.6.6-1.el6.remi.x86_64           @remi
        Obsoleted  ImageMagick-last-c++-6.9.6.6-1.el6.remi.x86_64       @remi
        Obsoleted  ImageMagick-last-c++-devel-6.9.6.6-1.el6.remi.x86_64 @remi
        Obsoleted  ImageMagick-last-devel-6.9.6.6-1.el6.remi.x86_64     @remi
        Obsoleted  ImageMagick-last-libs-6.9.6.6-1.el6.remi.x86_64      @remi
        Obsoleting ImageMagick6-6.9.6.8-1.el6.remi.x86_64               @remi
        Obsoleting ImageMagick6-c++-6.9.6.8-1.el6.remi.x86_64           @remi
        Obsoleting ImageMagick6-c++-devel-6.9.6.8-1.el6.remi.x86_64     @remi
        Obsoleting ImageMagick6-devel-6.9.6.8-1.el6.remi.x86_64         @remi
        Obsoleting ImageMagick6-libs-6.9.6.8-1.el6.remi.x86_64          @remi
    history info
    
     
  10. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    none of the last 3 yum updates would have packages that effect how nginx serves your web sites so not related to yum updates

    anything else you updated, changed etc around that time Dec 13-20th ?
     
    • Like Like x 1
  11. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
  12. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    for imagemagick update might try centmin.sh menu option 15 to update imagick php extension

    that's probably closest related change that would impact LEMP stack components of nginx, php-fpm etc

    how did you update kernel, doesn't list a kernel update in last 3 yum history transaction ids 23-25

    via system tap patch, probably not recommended as kernel has been fixed for that
     
  13. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    after making the test, I just hit yum update -y and rebooted
     
  14. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    k that should matter then
     
    • Like Like x 1
  15. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    lord help me
     
  16. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    what about output for this command to check your site headers
    Code (Text):
    curl -I http://yourdomain.com
     
    • Like Like x 1
  17. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    Code:
    curl -I domain.com
    HTTP/1.1 200 OK
    Date: Tue, 20 Dec 2016 18:23:17 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=d225fbde8540a5d88265771f8c7ccedc01482258197; expires=Wed, 20-Dec-17 18:23:17 GMT; path=/; domain=.domain.com; HttpOnly
    Vary: Accept-Encoding
    X-Powered-By: centminmod
    X-Page-Speed: 1.12.34.2-0
    Cache-Control: max-age=0, no-cache
    Server: cloudflare-nginx
    CF-RAY: 31451fe5f5d30749-AMS
    
    
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    Ah you're behind cloudflare maybe that is the problem ?

    If you use a reverse proxy in front of Centmin Mod Nginx, you need to setup nginx realip to be passed onto Nginx.

    See Getting Started Guide step 4 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 individual nginx vhost's server contexts has the include file /usr/local/nginx/conf/cloudflare.conf above the root directive

    i.e.
    Code (Text):
      include /usr/local/nginx/conf/cloudflare.conf;
      root /home/nginx/domains/censored.com/public;
    

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

    or
    Code (Text):
    service nginx restart
     
  19. emre22

    emre22 Member

    42
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    4:51 AM
    nginx-1.10.1
    MariaDB 10
    I dont think that this is the problem, all my domains are running behind cloudflare without the mentioned settings and all are running fine, except this one :( it was running until today somehow
     
  20. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    without the recommended settings all your nginx log visitor ips and your web apps recorded ips belong to cloudflare server ips and not your real visitor ips. If you do recommended setup, then real visitor ips are passed to your logs on your server and to your web apps

    if your wordpress install is setup to be rate limited or connection limited, then what happens is wordpress sees visitors all having cloudflare ip addresses and think it's an attack and blocks or rate limits access !