[SOLVED] installing certificate with Let's Encrypt
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If I run: [root@hostname]# letsencrypt certonly --webroot -w /certs -d example.com
I get this:
Code:
Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized ::
The client lacks sufficient authorization ::
Invalid response from http://example.com/.well-known/acme-challenge/randomlygeneratedstring [1.2.3.4]: 404
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: example.com
Type: unauthorized
Detail: Invalid response from http://example.com/.well-known
/acme-challenge/randomlygeneratedstring
[1.2.3.4]: 404
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
The thing is, the root directory is /var/www/html, not /var/www/html/example.
I don't have a folder called example (my domain, I mean, of course) under the html folder.
I just gave those paths as examples, put the correct path to your DocumentRoot folder for your domain.
Yes, I did so, but it's the same thing. I usually have a redirect directive configured in httpd.conf, but I deleted in order to see if it works - I saw that it uses 80 to check for the random string. But it doesn't work.
Yes, I already use a self-signed certificate. How does this affect the situation?
At a guess it's possible if you're redirecting the authentication request to SSL then LetsEncrypt is not accepting the self-signed cert.
Disable SSL (and redirection) on your site and just try it with pure http only
to see if that gets your cert issued.
For what it's worth, I changed my wife's blog to https with a letsencrypt cert in about 10 minutes. If you think it might be useful I captured each of my steps and can write it up.
What I did was back up httpd.conf and ssl.conf, the only configuration files that were different from the original, and I reinstalled apache. Then all of a sudden it worked:
Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem.
The problem is that I don't know why it didn't work before. I had deleted the welcome screen, indeed, and I had a few password protected folders (using httpd, basic authentication, etc.), but I don't know exactly what the trouble was.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.