Hello, I’m trying to install LE on a LAMP server (Ubuntu 16.4) [digital ocean] using certbot, however when I enter sudo certbot --apache in order to certificate my domain, my domain name is not on the list. Only an old subdomain is actually on the list.
This is what I get entering sudo certbot --apache
root@lamp-1gb-nyc3-01:~# sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
1: m.mywebsite.com
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
You will need to create a new certificate, but how to do so depends entirely on your environment. There’s no such thing as ‘transferring’ certificates in this manner, as they are immutable objects.
If you provide answers to the question prompts from when you made this thread, we could provide more assistance on how to receive a new certificate for this primary domain.
If the Apache configuration has a ServerName or ServerAlias setting for the domain, if you run the same Certbot command again, it should list it as one of the available choices, and offer to create a certificate for it.
root@lamp-1gb-nyc3-01:~# sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
1: m.mywebiste.com
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Certbot has no way to know what domain names are pointed at your server, so it tries to guess, by scanning your Apache configuration files to look for ServerName and ServerAlias directives. This also helps it to figure out where to put the directives to activate HTTPS for the correct site, if you have multiple sites.
If you don’t have a ServerName or ServerAlias for your main site, although Apache might still work, Certbot won’t be able to figure out your domain name automatically. There are ways to get around that, but the simplest and most robust solution is to add those directives to your configuration.