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

Domains How to properly remove a vhost domain ?

Discussion in 'Domains, DNS, Email & SSL Certificates' started by nVidian, Feb 22, 2018.

  1. nVidian

    nVidian Member

    90
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    10:45 AM
    1.7.9
    5.5
    Hello, I'm still testing to customize /usr/local/src/centminmod/inc/nginx_addvhost.inc for my need (Centmin Mod 123.09beta) . So I do a lot of add and remove one vhost domain, for example: sub1.domain.com.

    The way I remove it:
    - remove sub1.domain.com.conf from /usr/local/nginx/conf/conf.d
    - remove sub1.domain.com folder from /home/nginx/domains
    - remove sub1.domain.com folder from /usr/local/nginx/conf/autoprotect/ (I dont know what the purpose of autoprotect, but still remove it)
    - remove sub1.domain.com folder from /usr/local/nginx/conf/ssl/

    When I first add sub1.domain.com and choose Lets Encrypt, everything works including lets encrypt cert. But after I remove it using the above step and re-add vhost using menu #2, choose lets encrypt then the cert will fallback to self-signed cert. So now I could not get lets encrypt to work anymore for sub1.domain.com

    How to properly remove vhost domain completely so lets encrypt cert will just works everytime I re-added it ? OR how do I fix letsencrypt to work again for sub1.domain.com ?

    Thank you
     
    Last edited: Feb 22, 2018
  2. nVidian

    nVidian Member

    90
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    10:45 AM
    1.7.9
    5.5
    Solved using ./acmetool.sh reissue command

    Forgive my ignorance
     
  3. eva2000

    eva2000 Administrator Staff Member

    36,040
    7,906
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,188
    Local Time:
    1:45 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    To properly remove an Nginx vhost the instructions are on official site at How to delete Nginx vhost account for existing domain/subdomain ? as well as on each Nginx vhost creation's ending output too lists the commands.

    You also get a log file for each Nginx vhost created which also lists the commands in 123.09beta01 and higher example for http2.domain.com remove log at /root/centminlogs/centminmod_140218-021218_nginx_addvhost_nv-remove-cmds-http2.domain.com.log
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep remove
    -rw-r--r--   1 root root 1.3K Feb 14 02:12 centminmod_140218-021218_nginx_addvhost_nv-remove-cmds-http2.domain.com.log
    
     
  4. nVidian

    nVidian Member

    90
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    10:45 AM
    1.7.9
    5.5
    Thank you for your help.

    Maybe centminmod will have the "delete existing domain" menu in the future ? :)
     
  5. eva2000

    eva2000 Administrator Staff Member

    36,040
    7,906
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,188
    Local Time:
    1:45 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
..