Get the most out of your Centmin Mod LEMP stack
Become a Member

Website refused to connect after server reboot?

Discussion in 'System Administration' started by CarpCharacin, Jan 7, 2018.

  1. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    I rebooted my Linode VPS to update the kernel, but now when I try to visit my site, it says error connection refused.

    Edit: never mind, rebooting the VPS again fixed the issue.
     
    Last edited: Jan 7, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Strange issue.. all mine worked first reboot.
     
  3. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    Yeah, it's odd. I rebooted it again and it refused to connect after the reboot, so I tried again twice, but it still won't connect, so I'm going to submit a support ticket.

    Edit: restarting nginx and PHP fixed the issue, but it's still odd, because it has never happened until recently, but I have always had to restart dovecot after reboots to get webmail to work.
     
  4. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    centmin mod should start services it installed on reboot double check by enabling auto starts again
    Code (Text):
    chkconfig nginx on
    chkconfig php-fpm on
    chkconfig dovecot on
    
     
    • Like Like x 1
  5. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    Thanks. When I ran that for dovecot, it said this:
    Code (Text):
    Note: Forwarding request to 'systemctl enable dovecot.service'.
    Created symlink from /etc/systemd/system/multi-user.target.wants/dovecot.service to /usr/lib/systemd/system/dovecot.service.
    
     
  6. bassie

    bassie Well-Known Member

    1,025
    246
    63
    Apr 29, 2016
    Ratings:
    +726
    Local Time:
    1:29 AM
    For the future. If it happens again.
    If the website won't work, you couldn't ssh the server, etc etc you should use Linode Shell (Lish).
    Before considering crude actions.
     
    • Like Like x 1
    • Agree Agree x 1
  7. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that's correct output for systemd services as chkconfig is alias to systemctl enable command for centos 7
     
    • Like Like x 1
  8. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    Thankfully I was able to SSH in, but one time I accidentally locked myself out, and I used Lish to get access. What do you mean by crude actions?
     
  9. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    I rebooted to test it, and unfortunately it didn't work. The website refused to connect after the reboot. I was still able to SSH in though and restart nginx, PHP and dovecot.
     
  10. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Might need some troubleshooting with the following info
    • Server or VPS details ? XEN, KVM, OpenVZ, VMWare or dedicated server ? OS ? CentOS 6.9 or 7.4 ? 32bit or 64bit ?
    • What version of Centmin Mod ? .07 stable or 08 stable or .09 beta01 or another branch version ?
    • Was it fresh install or upgrade ?
    • Method of install ? Via centmin.sh menu option 1, Git install or curl one liner install as outlined at centminmod.com/download.html ?
    • How long ago did you install Centmin Mod ?
    • How are you rebooting the server ? via Linode manger or via SSH ? If via SSH what is exact command used ?
     
  11. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    It is a Linode KVM VPS with Centmin Mod 0.9 beta, that was the original version installed. I'm not sure how it was installed, it was over a year ago. I am rebooting the VPS through the Linode manager.
     
  12. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what's output for these commands
    Code (Text):
    service nginx status
    service php-fpm status
    service dovecot status
    


    it shouldn't matter where you reboot through but try via SSH command
    Code (Text):
    reboot
    
     
  13. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    The output for service nginx status was
    Code (Text):
    ● nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IM    AP/POP3 proxy server
       Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled)
       Active: active (running) since Tue 2018-01-16 16:03:20 UTC; 1h 1min ago
         Docs: man:systemd-sysv-generator(8)
      Process: 17889 ExecStop=/etc/rc.d/init.d/nginx stop (code=exited, status=0/SUC    CESS)
      Process: 17905 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=0/S    UCCESS)
     Main PID: 17918 (nginx)
       CGroup: /system.slice/nginx.service
               ├─17918 nginx: master process /usr/local/sbin/nginx -c /usr/local/...
               └─17921 nginx: worker process
    
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us systemd[1]: Starting SYSV: Ngin...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us nginx[17905]: Starting nginx: n...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us nginx[17905]: nginx: [warn] con...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us nginx[17905]: nginx: [warn] con...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us nginx[17905]: nginx: [warn] con...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us nginx[17905]: [  OK  ]
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us systemd[1]: PID file /usr/local...
    Jan 16 16:03:20 cyprinidae.utahfishkeepers.us systemd[1]: Started SYSV: Nginx...
    Hint: Some lines were ellipsized, use -l to show in full.
    

    The output for service php-fpm status was
    Code (Text):
    php-fpm (pid 17930) is running...
    You have new mail in /var/spool/mail/james
    

    And the output for service dovecot status was
    Code (Text):
    Redirecting to /bin/systemctl status dovecot.service
    ● dovecot.service - Dovecot IMAP/POP3 email server
       Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
       Active: active (running) since Mon 2018-01-15 22:16:37 UTC; 18h ago
      Process: 4197 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
     Main PID: 4204 (dovecot)
       CGroup: /system.slice/dovecot.service
               ├─ 4204 /usr/sbin/dovecot -F
               ├─ 4206 dovecot/anvil
               ├─ 4207 dovecot/log
               ├─18721 dovecot/auth
               ├─18947 dovecot/auth -w
               └─18948 dovecot/config
    
    Jan 16 16:58:46 cyprinidae.utahfishkeepers.us auth[18651]: pam_unix(dovecot:auth)...
    Jan 16 16:58:46 cyprinidae.utahfishkeepers.us auth[18651]: pam_unix(dovecot:auth)...
    Jan 16 17:02:37 cyprinidae.utahfishkeepers.us auth[18723]: pam_unix(dovecot:auth)...
    Jan 16 17:02:37 cyprinidae.utahfishkeepers.us auth[18723]: pam_unix(dovecot:auth)...
    Jan 16 17:03:37 cyprinidae.utahfishkeepers.us auth[18723]: pam_unix(dovecot:auth)...
    Jan 16 17:03:37 cyprinidae.utahfishkeepers.us auth[18723]: pam_unix(dovecot:auth)...
    Jan 16 17:05:59 cyprinidae.utahfishkeepers.us auth[18947]: pam_unix(dovecot:auth)...
    Jan 16 17:05:59 cyprinidae.utahfishkeepers.us auth[18947]: pam_unix(dovecot:auth)...
    Jan 16 17:06:27 cyprinidae.utahfishkeepers.us auth[18947]: pam_unix(dovecot:auth)...
    Jan 16 17:06:27 cyprinidae.utahfishkeepers.us auth[18947]: pam_unix(dovecot:auth)...
    Hint: Some lines were ellipsized, use -l to show in full.
    

    When I rebooted via ssh I had the same problem, the site refused to connect, but I was still able to SSH in after the reboot to restart nginx, PHP, and dovecot.
     
  14. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    for nginx status i see a warning line message what's output for
    Code (Text):
    nginx -t
    

    and
    Code (Text):
    ngxrestart
    
     
  15. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Are you running as full root user or a sudo user ? Centmin Mod should be run as full root user for admin level tasks
     
  16. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    Here is the output for nginx -t:
    Code (Text):
    [01:11][[email protected] centminmod]# nginx -t
    nginx: [warn] conflicting server name "utahfishkeepers.us" on 0.0.0.0:80, ignored
    nginx: [warn] conflicting server name "www.utahfishkeepers.us" on 0.0.0.0:80, ignored
    nginx: [warn] conflicting server name "utahfishkeepers.us" on [2600:3c01::f03c:91ff:fe2c:f69e]:80, ignored
    nginx: [warn] conflicting server name "www.utahfishkeepers.us" on [2600:3c01::f03c:91ff:fe2c:f69e]:80, ignored
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    

    And here is the output for ngxrestart:
    Code (Text):
    Restarting nginx (via systemctl):                          [  OK  ]
    

    I think as a full root user, after I log in before updating centmin mod or doing maintenance, I log into root using sudo su.
     
  17. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    you have conflicting server names again but that shouldn't prevent start up of services on reboot. Try logging in as root user instead of sudo to root as Centmin Mod admin and menu tasks aren't really made for sudo and then do chkconfig commands again.
     
  18. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    So I log in using the root password? That is the username targeted most by ssh attacks, so I have it disabled. How do I fix the conflicting server names?
     
  19. eva2000

    eva2000 Administrator Staff Member

    37,248
    8,137
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,527
    Local Time:
    10:29 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    CSF Firewall has login failure daemon (lfd) which blocks SSH attacks so that shouldn't be an issue as does changing SSHD port from default via centmin.sh menu option 16 where it asks for default ssh port first 22, then asks for the desired changed ssh port. Centmin Mod was created for root user management.

    example from /var/log/lfd.log logs
    Code (Text):
    tail -500 /var/log/lfd.log  | grep Failed | sed -e "s|$(hostname -s)|hostname|g"
    Jan 16 23:27:43 hostname lfd[29764]: (sshd) Failed SSH login from 101.71.29.235 (CN/China/-): 5 in the last 3600 secs - *Blocked in csf* [LF_SSHD]
    Jan 16 23:56:03 hostname lfd[29960]: (sshd) Failed SSH login from 91.242.159.184 (ES/Spain/-): 5 in the last 3600 secs - *Blocked in csf* [LF_SSHD]
    Jan 17 01:39:02 hostname lfd[3769]: (sshd) Failed SSH login from 212.158.160.74 (RU/Russian Federation/ns.ala.ru): 5 in the last 3600 secs - *Blocked in csf* [LF_SSHD]
    Jan 17 02:22:22 hostname lfd[11199]: (sshd) Failed SSH login from 209.150.52.78 (US/United States/209-150-52-78.s5196.c3-0.wsd-ubr2.qens-wsd.ny.cable.rcncustomer.com): 5 in the last 3600 secs - *Blocked in csf* [LF_SSHD]
    Jan 17 03:15:43 hostname lfd[9317]: (sshd) Failed SSH login from 191.85.245.49 (AR/Argentina/-): 5 in the last 3600 secs - *Blocked in csf* [LF_SSHD]
    


    BTW, how did you create the sudo user ?

    As to conflicting duplicate server_names, check if you have duplicate server_name listings for same domain names on same listen port 80 and/or port 443 via SSH command output all entries and inspect them
    Code (Text):
    grep -rn 'server_name' /usr/local/nginx/conf
    
     
  20. CarpCharacin

    CarpCharacin Member

    251
    19
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +30
    Local Time:
    5:29 PM
    1.15.6
    MariaDB 10
    I think with just adduser.
    Here is the log output:
    Code (Text):
    /usr/local/nginx/conf/uwsgi_params.default:17:uwsgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php-rediscache.conf:81:fastcgi_param  SERVER_NAME         server_name;
    /usr/local/nginx/conf/fastcgi.conf.default:23:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php-pool5.conf:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf:13:    server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf:26:    server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf:33:    server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/conf.d/ssl.conf:5:#    server_name  localhost;
    /usr/local/nginx/conf/conf.d/demodomain.com.conf:5:            server_name demodomain.com;
    /usr/local/nginx/conf/conf.d/demodomain.com.conf:12:            server_name www.demodomain.com;
    /usr/local/nginx/conf/conf.d/virtual.conf:4:            server_name li227-82.members.linode.com;
    /usr/local/nginx/conf/conf.d/carpcharacin.rocks.ssl.conf:6:   server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/conf.d/carpcharacin.rocks.ssl.conf:14:  server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/phpssl.conf:62:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/fastcgi.conf:23:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/fastcgi_params.default:22:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-040117-212952:5:   server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-040117-212952:6:   return 302 https://$server_name$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-040117-212952:12:  server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093507:10:   server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093507:16:  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093341:10:   server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093341:16:  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-092946:10:            server_name utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-092946:18:#  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-092946:19:    server_name www.utahfishkeepers.us
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-170917-064550:6:   server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-170917-064550:14:  server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-092946:10:   server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-092946:16:  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.conf-backup-removal-https-default-040117-212952:9:#            server_name carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.conf-backup-removal-https-default-040117-212952:15:  server_name carpcharacin.rocks www.carpcharacin.rocks;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093507:10:            server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093507:18:#  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093507:19:    server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-170917-064603:13:    server_name utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-170917-064603:26:    server_name www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-170917-064603:33:    server_name www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093341:10:            server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093341:18:#  server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093341:19:    server_name utahfishkeepers.us www.utahfishkeepers.us;
    /usr/local/nginx/conf/nginx.conf.default:37:        server_name  localhost;
    /usr/local/nginx/conf/nginx.conf.default:87:    #    server_name  somename  alias  another.alias;
    /usr/local/nginx/conf/nginx.conf.default:100:    #    server_name  localhost;
    /usr/local/nginx/conf/nginx.conf:27: server_names_hash_bucket_size 128;
    /usr/local/nginx/conf/nginx.conf:28: server_names_hash_max_size 2048;
    /usr/local/nginx/conf/nginx.conf:79:        server_name_in_redirect off;
    /usr/local/nginx/conf/scgi_params.default:17:scgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/scgi_params:17:scgi_param  SERVER_NAME        $server_nam ;
    /usr/local/nginx/conf/php-pool2.conf:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php-pool3.conf:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/phpalt.conf:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php-rediscache-shortttl.conf:81:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php.conf:70:fastcgi_param  SERVER_NAME        $server_nam ;
    /usr/local/nginx/conf/php.conf-oldversion_021216-075724:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/uwsgi_params:17:uwsgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/php-pool4.conf:70:fastcgi_param  SERVER_NAME        $server_name;
    /usr/local/nginx/conf/fastcgi_params:31:fastcgi_param  SERVER_NAME        $server_name;
    
     
..