Learn about Centmin Mod LEMP Stack today
Register Now

Letsencrypt Official acmetool.sh testing thread for Centmin Mod 123.09beta01

Discussion in 'Domains, DNS, Email & SSL Certificates' started by eva2000, Jul 26, 2016.

  1. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    trying to set up a new SSL site and get an SSL cert for it.

    Code:
    !! Error: thepipestand.com DNS records not found or setup properly yet or thepipestand.com invalid
    
    Abort this Nginx vhost domain setup to setup proper DNS A record(s) first? [y/n]:
    
    and from here
    DNS Report - ViewDNS.info

    And in CloudFlare DNS

    Screen Shot 2016-10-22 at 8.29.48 PM.png


    Ping from the server trying this on

    Screen Shot 2016-10-22 at 8.31.14 PM.png

    In the vhost that is configured for SSL under the latest code (as pulled at time of this post) - looks like double entry of config data? This is after getting the above error about the DNS and telling it continue.

    Code:
    [root@whiskey conf.d]# cat thepipestand.com.ssl.conf
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #x# HTTPS-DEFAULT
     server {
      
       server_name thepipestand.com www.thepipestand.com pipejunkie.com www.pipejunkie.com www.pipejunkies.com pipejunkies.com tntpipes.com www.tntpipes.com;
       return 302 https://$server_name$request_uri;
       include /usr/local/nginx/conf/staticfiles.conf;
     }
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For SPDY SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # server {
    #       listen   80;
    #       server_name thepipestand.com www.thepipestand.com;
    #       return 302 https://$server_name$request_uri;
    # }
    
     
  2. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    It turns out it only does a self-signed certificate... I can run acme.sh manually and pull a cert in fine.
     
  3. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    that's a weird one, at bottom of 1st post of this thread has troubleshooting section so need some log info.

    If letsencrypt fails to validate the domain to issue the letsencrypt ssl certificate, acmetool.sh falls back on the prior self-signed ssl certificate. So it's possible the the acmetool.sh DNS check was correct in not finding your DNS for domain and letsencrypt server end couldn't find it either, so failed to validate domain and issue letsencrypt ssl cert.

    Troubleshooting Issues



    There are various steps you can do to troubleshoot failed letsencrypt issuances, renews, reissues etc.
    • acmetool.sh logs all command line or shell menu runs to log files at /root/centminlogs. To troubleshoot, copy the contents of the log run and post contents of log to pastebin.com or gist.github.com and share link in this thread. To find the log list the logs in ascending date order
      Code (Text):
      ls -lahrt /root/centminlogs
      .
    • For direct acmetool.sh runs, there should be a 2nd & 3rd & 4th log in format /root/centminlogs/centminmod_${DT}_nginx_addvhost_nv.log and /root/centminlogs/acmetool.sh-debug-log-$DT.log and /root/centminlogs/acmesh-issue_*.log or /root/centminlogs/acmesh-reissue_*.log which would need to be included via separate pastebin.com or gist.github.com post.
     
    Last edited: Oct 23, 2016
  4. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    But it should.. I was able to use acme.sh and it verified the domain just fine... Which log file you want.. I have a TON of them for the tool in there... and yes, it's only generating self-signed certificate.

    You are about to create an Nginx vhost site account with/without HTTPS/SSL supp - Pastebin.com
    [root@whiskey centminlogs]# cat acmetool.sh-debug-log-221016-205847.log [Sat Oc - Pastebin.com
     
  5. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    i think the problem is you ran centmin.sh menu option 2 for a domain that already exists on the server ? so it totally skipped the trigger in inc/nginx_addvhost.inc to call addons/acmetool.sh to do it's thing including properly adjusting the nginx ssl vhost by switching out the self-signed ssl cert for letsencrypt issued ssl cert.

    Code (Text):
    ---------------------------------------------------------------
    To get Letsencrypt SSL certificate, you must already have updated intended
    domain vhost name's DNS A record to this server's IP addresss.
    If top level domain, DNS A record is needed also for www. version of domain
    otherwise, Letsencrypt domain name validation will fail.
    ---------------------------------------------------------------
    continue [y/n] ? y
    
    
    !! Error: thepipestand.com DNS records not found or setup properly yet or thepipestand.com invalid
    
    Abort this Nginx vhost domain setup to setup proper DNS A record(s) first? [y/n]: n
    
    ------------------------------------------------
    You have 4 options:
    ------------------------------------------------
    1. issue staging test cert with HTTP + HTTPS
    2. issue staging test cert with HTTPS default
    3. issue live cert with HTTP + HTTPS
    4. issue live cert with HTTPS default
    Enter option number 1-4: 4
    
    
    
    -------------------------------------------------------------
    vhost for thepipestand.com already exists
    /home/nginx/domains/thepipestand.com already exists
    -------------------------------------------------------------
    
     
  6. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    Nope.. it happened before it existed.. this was a brand new domain (I'm rebranding pipejunkie.com).. and it WILL issue fine using acme.sh ;)

    Screen Shot 2016-10-22 at 9.30.20 PM.png
     
  7. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    strange then - if you can zip up the /root/centminlogs/ for the date(s) you ran the centmin.sh menu option 2 including all /root/centminlogs/centminmod_${DT}_nginx_addvhost_nv.log and /root/centminlogs/acmetool.sh-debug-log-$DT.log can private conversation me a link for them. I can go over them to see if i can see anything.
     
  8. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    also there should be a /root/centminlogs/acmesh-issue_*.log also
     
  9. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    It could be dns then worked when you ran acme.sh manually. How many times did you run centmin.sh menu option 2 after the 1st failed attempt ?
     
  10. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    More than 2 and less than 10.. :)
    And the acme.sh worked prior to running the process of letting centMin create a new vhost. I got a new certificate but was having issues with IPS ( and still am - surprise surprise) not playing on the new domain so decided to create a new vhost.
     
  11. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    well i plugged that flaw in update to 123.09beta01 so there's an earlier existing vhost domain check right after you enter the vhost domain name to add Beta Branch - update inc/nginx_addvhost.inc move existing vhost check higher in routine | Centmin Mod Community

    That should prevent folks from re-running centmin.sh menu 2 when they already have an existing vhost domain. There's a check but prior to the update, it was further down in the routine.

    Whether that contributed to the your original issue, hard to say.
     
  12. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    Don't think it contributed as I got that error (about the DNS) on the first attempt with no vhost created for that domain. I even went in twice and deleted the vhost definition and all associated files for it and still got the DNS error. :eek:

    now I'm trying to get IPS ACP to respond on the new domain instead of forcing the old domain.. I'm beginning to see once more why I hate IPS.
     
  13. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    strange then could be DNS issues as i check against 8.8.8.8 could be a temp problem there. Unfortunatley, letsencrypt doesn't publish which DNS servers they check against, so it's hard to 100% replicate their checks before actually going through the letsencrypt domain validation process

    maybe need to use more than one public DNS to check against instead of just 8.8.8.8
     
  14. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    Yeah.. I use CloudFlare to manage my DNS, so it typically hits out pretty quickly - especially to Googles DNS servers.
     
  15. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    on the actual server what was your local DNS resolvers in /etc/resolv.conf ? 8.8.8.8 too ?

    I just made a slight fix in acmetool.sh 1.0.11 update released just now for 123.09beta01 for nginx vhost dns check Beta Branch - acmetool.sh 1.0.11 | Centmin Mod Community

    basically change from
    Code (Text):
    dig soa $vhostname_dns | grep -v ^\; | grep SOA | awk '{print $1}' | sed 's/\.$//'

    to
    Code (Text):
    dig soa @8.8.8.8 $vhostname_dns | grep -v ^\; | grep SOA | awk '{print $1}' | sed 's/\.$//'

    if the value returned from command is empty, you would of gotten the message you ran into
    Code (Text):
    !! Error: $vhostname_dns DNS records not found or setup properly yet or $vhostname_dns invalid
     
  16. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    8.8.8.8
    8.8.4.4
    213.186.33.99 (believe this is OVH's).

    Like I said earlier.. acme.sh runs (and pulls) fine.. it was the centmin mod tool that had the issue (apparently when talking to acme.sh?).
     
  17. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    bundle up the logs (they may contain vhost pure-ftpd logins etc), so private conversation link me them and i can take a look. There should be a /root/centminlogs/acmesh-issue_*.log also that's the one triggered from centmin.sh menu option 2 runs when you opt for letsencrypt ssl cert with LETSENCRYPT_DETECT='y' enabled to log everything on the acmetool.sh letsencrypt routines. There should be one that corresponds to the first time you ran centmin.sh menu option 2.
     
  18. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    I'll filter through them once I get through battling IPS.. still showing insecure content - but I'm not according to Chrome also... argh.. why did I want to change the stinking domain name.
    went from pipejunkie.com to thepipestand.com because folks were commenting that the domain name looked like a "doper" site.
     
  19. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    6:56 PM
    1.21.6
    MariaDB 10.3.36
    OK.. I've wiped all the directories, removed the vhost definition and reran option 2 from CentMin... and here is what it shows when going to create a LetsEncrypt SSL cert.

    Screen Shot 2016-10-23 at 3.59.52 AM.png

    Sure does look like it's finding the A records for both the www and non-www domain.
    I don't know why it's prompting me to abort to set up a proper DNS A record when it's already showing it exists :banghead:
     
  20. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:56 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    ok, checked, there's no check for that it asks if you want to abort whether or not the A DNS record exists or not. As it could be the end user has old outdated DNS A records etc. Centmin Mod isn't able to tell if the end user's desired DNS A records are the ones they want.

    Probably can add a check so if DNS A record is same as the server IP the user is running centmin.sh on.

    edit: updated 123.09beta01 for such a check now Beta Branch - update inc/nginx_addvhost.inc update DNS checks in 123.09beta01 | Centmin Mod Community :)
     
    Last edited: Oct 23, 2016