User Tools

Site Tools


wiki:expand_existing_letsencrypt_certficate_multiple_domains

Expand existing letsencrypt certficate for multiple domains

Check existing certifcates

certbot-auto certificates

Expand existing one

Remember to include the already existing domain certificate (staging.example.com).

certbot-auto certonly --expand -d staging.example.com,subdomain1.staging.example.com,subdomain100.staging.example.com,subdomain200.staging.example.com

This will result in a certificate valid for all above domains.

Tweak the apache configuration

Only additions are shown below.

Non ssl conf:

...
ServerAlias *.staging.example.com
...
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

SSL conf:

...
ServerAlias *.staging.example.com
...
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/staging.example.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/staging.example.com-0001/privkey.pem

Tested on

  • Debian 10.7

See also

wiki/expand_existing_letsencrypt_certficate_multiple_domains.txt · Last modified: 2021/01/14 16:38 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki