Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Letsencrypt certificate for www and non-www domain

I have generated SSL certificate like so:

sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt ./letsencrypt-auto certonly --standalone 

Then I was asked for email ... and a domain name. I entered 'mydomain.com'

I figured out that I could enter multiple domains to be included in one certificate using different approach. E.g.:

sudo -H ./letsencrypt-auto certonly --standalone -d example.com -d www.example.com 

I wonder if I could have entered multiple domains when I was promoted for them in a dialog or now I need to regenerate using a different approach?

Do I need to remove previous letsencrypt installation before going new way?

UPDATE -> SOLVED

sudo ./certbot-auto certonly --standalone -d mydomain.com -d www.mydomain.com 
like image 447
user2814599 Avatar asked Dec 12 '16 09:12

user2814599


People also ask

Do I need a different SSL certificate for www and without?

You don't need a separate SSL for www and non www, although the specifics depend on which certificate type you have: Single domain: secures www and non-www by default.

Can I use Letsencrypt without domain?

No, it continues to not be possible from Let's Encrypt.

How do I get free HTTPS on my site using Let's encrypt SSL?

Now that the certificate has been installed, you may use it to secure your site: Go to Websites & Domains and click Hosting Settings. Select the SSL/TLS support checkbox. Select the Let's Encrypt certificate you have just received from the Certificate menu, and click OK.


1 Answers

You do not need to remove the installed certificate.

You can extend it to your sub-domain if you're using the same domain. Do the following:

sudo certbot certonly --standalone -d domain.com -d www.domain.com 

When prompted for Expanding or Cancelling, reply with E then hit Enter key on your keyboard.

The certificate should be setup successfully.

If you encounter this error: Problem binding to port 80: Could not bind to IPv4 or IPv6, stop apache by running systemctl stop apache2 then run the above certbot command again.

Once the ssl certificate is successfuly setup, run systemctl restart apache2 to get apache up and running again.

like image 55
mutiemule Avatar answered Sep 28 '22 05:09

mutiemule