I am trying to generate an SSL certificate for a subdomain that was purchased using Wordpress. Both the domain and subdomain were purchased from Wordpress. For the subdomain created using Wordpress, I have created a A
record with IP pointing to some external server. Now I want to generate a SSL certificate for this subdomain. How can I do this?
Here is what I tried using sudo certbot certonly --webroot
command but gives the following errors.
What is it that I am missing?
You will need to perform the certificate generation action on the server with the IP you specified in your DNS
A Record
.or
If that is not possible you can also execute the
certbot
command with the--manuel
flag. (Official Docs)Now here you will need to create a new DNS
TXT
record with the value displayed. (In this case its2DYIfZh7Q38VnQuUvsIWJt0QffSJvCnHNOnlEuRim66
) And wait a few minutes before pressing enter since the deployment will take some time. Don't delete the record afterwards, otherwise renewing will not work!Now press enter and it should see sometime like this:
And now your certificates will be laying in the folder
/etc/letsencrypt/live/<your-domain>/
.Explanation on how the "HTTP challenge" works