Install Lets Encrypt for domain with multiple dots in apache. ubuntu

For the other server, I currently do not have login access I will check & confirm.
For current server, I now understood. I initially thought my IP will also be automatically secured via letsencrypt.

Thank you for your prompt response. I really appreciate your help.

I have one last question- I am not able to access my website via alias i.e. for example.com my alias was www.example.com. Is their any change I need to make in my config file?

VirtualHost configuration for current server:
*:443 is a NameVirtualHost
default server example.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
port 443 namevhost example.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
alias www.example.com
port 443 namevhost example.ca.example.com (/etc/apache2/sites-enabled/example.ca.example.com-le-ssl.conf:2)
*:80 is a NameVirtualHost
default server example.ca.example.com (/etc/apache2/sites-enabled/example.ca.example.com.conf:1)
port 80 namevhost example.ca.example.com (/etc/apache2/sites-enabled/example.ca.example.com.conf:1)
port 80 namevhost example.com (/etc/apache2/sites-enabled/example.com.conf:1)
alias www.example.com

example.com and www.example.com are different domain names, you need a certificate for both and you need to tell your webserver to answer for both. (ServerAlias I think)

2 Likes

I do have both domains set up pointing to the same ip address.
Also defined the same in configuration file as a ServerAlias but still its not working.

is the certificate valid for both?

1 Like

I didn't installed certificate for www.example.com. I thought it to be alias & only mentioned in the configuration file.
So what do you suggest, shall I expand the certificate for www.example.com & then it should work?

The certificate should contain both domains.

certbot [your options] -d example.com -d www.example.com

2 Likes

Earlier I used below command to install ssl certificate, so shall i add another domain
in below command -d www.example.com, to make it work.

certbot --apache --expand --cert-name example.com -d example.com -d example.ca.example.com

Also, is there any limit to expand the same certificate for the number of domains?

1 Like

It should work if you add another, same command.

You can have up to 100 domains per certificate.

3 Likes

Thank you for your response. I will check & let you know if that fix that issue.

1 Like

Thank you team, It worked fine thanks for your help. Appreciate your assistance :slight_smile:

3 Likes

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