How to setup certificate for "www" subdomain?

Hello, I have just setup a new SSL certificate with Certbot on my site, but I have been unable to set it up for "" because Certbot didn't give me the option of it even though it is defined as an alias in the Apache configuration of the site. How can I install the certificate for the "" version of my site as well?

My domain is:

I ran this command: certbot --apache

It produced this output: I had just two options: install the certificate for "" or "" which is another subdomain we use. But not for "" which is the official full domain of my site.

My web server is (include version): Apache/2.4.38 (Debian)

The operating system my web server runs on is (include version): Debian 10

I can login to a root shell on my machine (yes or no, or I don't know): YES with root access

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): NO

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.31.0

1 Like

Please show this part of the config:

AND also the output of:
apachectl -S

1 Like

Thank you rg305, I actually solved the problem myself. I just tackled the Apache config file for the site by changing this line:




And then called Certbot again:

certbot --apache

And this time it showed me the www option.

Thank you anyway for your help :slight_smile:

That isn't the correct fix to this problem.
It only changes the problem from one name to the other.
You need to use both names.


After you've properly added the ServerAlias line as @rg305 indicated, Certbot will prompt you to include both names on your certificate!


Yes, I did that, I forgot to mention it.

Thank you very much! :slight_smile:


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