Letsencrypt certificate for www and non-www domain

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 example.com -d www.example.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.

Leave a Comment