Welcome to Centmin Mod Community
Register Now

Nginx Deleted Nginx vhost and nginx hangs?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by cloud9, Apr 9, 2022.

  1. cloud9

    cloud9 Premium Member Premium Member

    435
    118
    43
    Oct 6, 2015
    England
    Ratings:
    +218
    Local Time:
    9:13 AM
    1.25.3
    10.6.x
    Latest CMM, 8.0.16php mysql 10.3 centos7 64 bit

    really weird this

    2 XF forums both on the same vps


    1 used and working
    1 not used and not working

    after a few days the working one takes on the template of the non working one - by template I mean the bolt header with links and the footer and also turns itself off

    It all works but the theme is completely screwed as it appear to be trying to use the one from the xf that isnt working

    So rebuild server from backup and all works fine

    As this has happened twice now I decided to delete the vhost files for the xf install thats not used/working

    ran the delete files in ssh from the cmm install output

    Code:
    Commands to remove mydomain.com
    
    pure-pw userdel forumss
     rm -rf /usr/local/nginx/conf/conf.d/mydomain.com.conf
     rm -rf /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf
     rm -rf /usr/local/nginx/conf/ssl/mydomain.com/mydomain.com.crt
     rm -rf /usr/local/nginx/conf/ssl/mydomain.com/mydomain.com.key
     rm -rf /usr/local/nginx/conf/ssl/mydomain.com/mydomain.com.csr
     rm -rf /usr/local/nginx/conf/ssl/mydomain.com
     rm -rf /home/nginx/domains/mydomain.com
     rm -rf /root/.acme.sh/mydomain.com
     rm -rf /root/.acme.sh/mydomain.com_ecc
     rm -rf /usr/local/nginx/conf/pre-staticfiles-local-mydomain.com.conf
     service nginx restart
    
    All deleted

    Now nginx hangs on restart

    Code:
    [21:12][root@server.linuxnginx.com ~]# service nginx restart
    Restarting nginx (via systemctl):  
    So just restored another backup and all fine but cant see why its doing this

    What can I look for as this is like a said really weird
     
    Last edited: Apr 9, 2022
  2. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    6:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Who is your web host?

    When Nginx restart hangs, what's output for command
    Code (Text):
    nginx -t


    How many active Nginx sites are running on the server?
     
  3. cloud9

    cloud9 Premium Member Premium Member

    435
    118
    43
    Oct 6, 2015
    England
    Ratings:
    +218
    Local Time:
    9:13 AM
    1.25.3
    10.6.x
    Hetzner CX41

    Have rebuilt server so will do nginx -t in a bit as ill run through the delete again
     
  4. cloud9

    cloud9 Premium Member Premium Member

    435
    118
    43
    Oct 6, 2015
    England
    Ratings:
    +218
    Local Time:
    9:13 AM
    1.25.3
    10.6.x
    Ok, Thanks @eva2000

    I didnt realise that any other .conf in
    /usr/local/nginx/conf/conf.d/ would cause issues

    I had 4 other ones for the domain I removed these

    Code:
    mydomain.ssl.backup.conf
    mydomain.com.ssl.conf.backup
    mydomain.com.ssl.conf.centmin
    mydomain.com.ssl.IPS.conf
    Nginx then restarts

    Dont know why the SSH window froze, today is just returned the nginx error as did nginx -t
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    6:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    They will cause issues if they end in .conf extension as that is what Nginx is picking up as a valid config so .backup.conf and .ips.conf are probably the culprits. Rename to end with .backup extension should fix it