Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: mylifetalks.org
I ran this command:
sudo certbot --apache
It produced this output:
Requesting a certificate for `app-api-1022.mylifetalks.org`
Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: `app-api-1022.mylifetalks.org`
Type: unauthorized
Detail: 13.235.121.134: Invalid response from `http://app-api-1022.mylifetalks.org/.well-known/acme-challenge/(redacted)` 404
Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure that the listed domains point to this Apache server and that it is accessible from the internet.
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Unable to restart apache using ['apache2ctl', 'graceful']
Encountered exception during recovery: certbot.errors.MisconfigurationError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Some challenges have failed.
My web server is (include version):
Apache2 2.4.29
The operating system my web server runs on is (include version):
Ubuntu 18.04
My hosting provider, if applicable, is:
GoDaddy
I can login to a root shell on my machine (yes or no, or I don't know):
Yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
No
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): Certbot 1.29.0
Ah I see - apologies, as I'm definitely new to this. I was planning on using Apache per instructions I've been reading, and in fact I didn't realize AWS images came with nginx already installed. Is there a preference/recommendation between the two? Since nginx is already running, I'm certainly happy to use that. Thanks for your help!
Thanks @rg305 I'm very happy to listen to the experts, and can definitely uninstall Apache and use nginx. So in the last half hour I've been doing some digging and it seems there is an existing .conf file at etc/nginx/sites-enabled which was setup before I took this over (I was under the impression no SSL work had been done at all yet). In this existing file, I do see references to letsencrypt certificates. So some work has already been done using nginx, but not related to the subdomain I've cited, app-api-1022...
however..
when I then run what I assume is the correct command I should be running, sudo certbot --nginx, I get prompted with a question of which names would I like to activate https for? And it gives me one option, just the one from the aforementioned pre-existing .conf file. Whereas when I did sudo certbot --apache it actually asked me to type in the domain name I need the cert for. So my question is, how do I explicitly pass the app-api-1022.mylifetalks.org domain to the certbot nginx command?
Certbot will create a server block for listen 443 (https) based on this starter block. You then customize this https block as needed. The starter http block will be modified to just become a redirect to the https server.
I don't have a working Apache setup, as it was determined through this thread that nginx is already running and using the ports that Apache would have been using. Further, my original intent to use Apache was before 1) I realized someone had already done some work on this box using nginx 2) user rg305 suggested he prefers nginx over Apache anyway.
So I'm a bit confused by your last post asking "why?". I was going to do exactly what you've suggested but you're asking me why I'm going to implement your suggestion? Just want to make sure I'm not missing something here...
I prefer nginx too but many people prefer Apache. You originally tried to use Apache while nginx was running and you asked how best to proceed. But, now Apache is running so the situation has changed.