Setting up LetsEncrypt with WWW

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.

Staging 1 SSL Labs
Staging 2 SSL Labs

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.

I am using Namecheap default DNS. How do I do a www for a subdomain? create a CNAME?

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.

1 Like

Thank you very much! :slight_smile:

Hello,

Sorry bother you again but I created a CNAME but it doesn’t seem to do anything?

I think you accidentally created it for www.joyal.in rather than for www.staging1.joyal.in and www.staging2.joyal.in.

Would this be the correct method of doing it?

Assuming that the hidden part behind the … is “in.”, I think that should work.

Following the pattern of your example above, you could also just say “www.staging1” and “www.staging2” instead of “www”.

Thanks, will try and see if that fixes things :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.