Learn about Centmin Mod LEMP Stack today
Register Now

Beta Branch ensure Nginx vhost domain's ssl directory is removed

Discussion in 'Centmin Mod Github Commits' started by eva2000, Aug 25, 2015.

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    55,153
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  2. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    2:29 PM
    does this mean I need to remove crt, key, csr files in directory /usr/local/nginx/conf/ssl?
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,153
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no no.. when you create a new vhost via centmin.sh menu option 2 or /usr/bin/nv at end of the generated vhost there's a message giving you the commands needed to remove the nginx vhost generated. The command note was missing the command to remove /usr/local/nginx/conf/ssl

    example at end of nginx vhost creation you now see messages below

    the incorrect one
    Code:
    -------------------------------------------------------------
    Commands to remove newdomain5.com
    
    rm -rf /usr/local/nginx/conf/conf.d/newdomain5.com.conf
    rm -rf /usr/local/nginx/conf/conf.d/newdomain5.com.ssl.conf
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.crt
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.key
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.csr
    rm -rf /home/nginx/domains/newdomain5.com
    service nginx restart
    -------------------------------------------------------------
    and the corrected one via this commit which added the removal of /usr/local/nginx/conf/ssl/newdomain5.com
    Code:
    -------------------------------------------------------------
    Commands to remove newdomain5.com
    
    rm -rf /usr/local/nginx/conf/conf.d/newdomain5.com.conf
    rm -rf /usr/local/nginx/conf/conf.d/newdomain5.com.ssl.conf
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.crt
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.key
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com/newdomain5.com.csr
    rm -rf /usr/local/nginx/conf/ssl/newdomain5.com
    rm -rf /home/nginx/domains/newdomain5.com
    service nginx restart
    -------------------------------------------------------------
     
  4. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    2:29 PM
    Thanks for clearing @eva2000

    Is it okay to delete my .crt .csr .key file at /usr/local/nginx/conf/ssl? I have only one domain. Please advise.
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,153
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    if you don't use HTTPS or SSL certificate for your domain, then yes you can delete them but the directory would be /usr/local/nginx/conf/ssl/yourdomain.com/ where they would be.