Installing Let's Encrypt fails

System: Ubuntu 18.04

 

I installed Countly on a vps like so:

sudo su - 
wget -qO- http://c.ly/install | bash

 

Immediately after I tried to setup Let's Encrypt

~# certbot --authenticator standalone --installer nginx -d countlytest.my-domain.com -d  countlytest.my-domain.com --pre-hook "service nginx stop" --post-hook "service nginx start"
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): email@email.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: a
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n
Running pre-hook command: service nginx stop
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for countlytest.my-domain.com
Waiting for verification...
Cleaning up challenges
Running post-hook command: service nginx start
Could not automatically find a matching server block for countlytest.my-domain.com. Set the `server_name` directive to use the Nginx installer.IMPORTANT NOTES:
- Unable to install the certificate
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/countlytest.my-domain.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/countlytest.my-domain.com/privkey.pem
Your cert will expire on 2020-05-15. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew *all* of
your certificates, run "certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.

Setting it up automatically like so

sudo certbot --nginx

did not work either. I'm also unable to connect to the dashboard via the subdomain and https. Connecting via IP and http does work. Connecting via subdomain and http does work, too.

Also ufw is inactive. Not sure where I went wrong following the guide. Help is highly appreciated!

0

Comments

4 comments
  • Official comment

    Hello Benjamin,

    You need to have a domain name which is pointing to your server when you try to get SSL certificate with Let's Encrypt by HTTP challenge.

    Could not automatically find a matching server block for countlytest.my-domain.com. Set the `server_name` directive to use the Nginx installer.

    Please set a domain name to your server's IP and add `server_name` directive to your NGINX config as this line from your output explained.

    Comment actions Permalink
  • Following this documentation: https://support.count.ly/hc/en-us/articles/360037816431-Configuring-HTTPS-and-SSL immediately afterwards and replacing all contents of this file /etc/nginx/sites-available/default with the box below in the guide ... then fails to restart nginx:

     

    # sudo service nginx restart
    Job for nginx.service failed because the control process exited with error code.
    See "systemctl status nginx.service" and "journalctl -xe" for details.

     

     

    0
    Comment actions Permalink
  • After starting with a fresh vps I also tried with bleeding edge:

    wget -qO- http://c.ly/install | bash -s dev

    But no luck either. Same issue when setting up Let's Encrypt certificate

    0
    Comment actions Permalink
  • Thanks Kaan! That was it. I was able to set up Let's Encrypt like so:

    # vim /etc/nginx/sites-available/default

    Change server name to subdomain without https://. Save and quit.

    Check for nginx config errors: # service nginx restart

    Run certbot like so: # certbot --nginx

    0
    Comment actions Permalink

Please sign in to leave a comment.