How to combine certificates?

Hello,

I did not know I could combine certificates for subdomains.

I used this command on Ubuntu

certbot --apache -d example.com

How to combine certificates for new subdomains?

Thanks

Have a look into the official documentation:

So I would have to use this?

certbot certonly --cert-name example.com -d blog.example.org,forum.example.com

Is it correct? Or should I add apache too?

If you used --apache before, you should add it of course.

So the command would be like that?

certbot certonly --cert-name example.com --apache -d blog.example.org,forum.example.com

Do I have to add example.com after the -d too or not?

The argument to --cert-name is the name which is displayed when calling certbot certificates, its for identification only. All domains which should be included in the certificate must be given to parameter -d.

Ok then it should be like that I suppose

certbot certonly --cert-name example.com --apache -d blog.example.org,forum.example.com,example.com

But with this it won’t modify the apache configuration right?

What is the right command to add a certificate to a subdomain if I already have the certificate for the domain?

I think there’s a bit of confusion of terms here. Are you asking how to issue a certificate that includes all the domains and subdomains you need? Or are you asking how to set that up in Apache?

For the former, the answer is that you need to issue a new certificate. Certificates, once issued, are immutable. You cannot add to it, you can only discard it and get a new one with all of the names you want.

For the latter, no, this will not configure your webserver. The certonly command does just what it says - in only gets the certificate. You’ll need to go into your Apache configs and apply the newly issued certificate (including all the names) to your vhost blocks.

Clear now thanks.

So if I had already a certificate for a domain and then I decide to create a new subdomain, the best way would be to create a new certificate, correct?

Yep! That’s the best, and really only, way.

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