Welcome to Centmin Mod Community
Become a Member

How to properly remove a vhost domain ?

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

  1. nVidian

    nVidian Member

    97
    8
    8
    Mar 16, 2015
    Ratings:
    +31
    Local Time:
    10:29 PM
    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

    97
    8
    8
    Mar 16, 2015
    Ratings:
    +31
    Local Time:
    10:29 PM
    1.7.9
    5.5
    Solved using ./acmetool.sh reissue command

    Forgive my ignorance
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:29 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    97
    8
    8
    Mar 16, 2015
    Ratings:
    +31
    Local Time:
    10:29 PM
    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

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:29 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  6. MaximilianKohler

    MaximilianKohler Member

    197
    5
    18
    Jun 23, 2023
    Ratings:
    +29
    Local Time:
    7:29 AM
    I have no such files in that directory. I created a vhost recently.
    Code:
    find /root/centminlogs -type f -name "*nginx_addvhost*"
    Oh, the "nginx_addvhost" is at the end...