Please fill out the fields below so we can help you better.
My domain is: staging1.joyal.in and staging2.joyal.in
I ran this command: letsencrypt --apache
It produced this output:
My operating system is (include version): Ubuntu 16.04 (Xenial)
My web server is (include version): Apache2
My hosting provider, if applicable, is: Ramnode
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
I am able to setup letsencrypt for non www links but if I use www it doesn’t work. I am new to using virtual hosts and I setup 2 sites to see how it would work. Please help on fixing this issue.
Hi @JoyalV, the trouble is that the www versions literally don’t exist at all in the public DNS. (staging2.joyal.in exists, but www.staging2.joyal.in doesn’t, and likewise staging1.joyal.in exists but www.staging1.joyal.in doesn’t.) Let’s Encrypt can’t issue certificate for names that aren’t referred to in publicly-visible DNS records. So you need to update your DNS settings to add the www forms, presumably pointing to the same server.
In general, creating some DNS record for example.com won’t automatically create the corresponding record for www.example.com.
If you can create a CNAME record pointing to the non-www form, like www.staging2.joyal.in IN CNAME staging2.joyal.in, that should work fine, and then Certbot should be able to get a cert that includes this.