Added wildcard, creating a new Web Domain within wildcard domain

I’ve created Let’s Encrypt wildcard for subdomain app.domain.com (*.app.domain.com).
So I have exactly an object Web Domain app.domain.com in HestiaCP, with alias *.app.domain.com.

I added a new Web Domain object (e.g. separate WordPress installation), with domain example1.app.domain.com.

How should I include this subdomain example1.app... automatically into wildcard SSL under app.domain.com?

Hestia doesn’t provide a direct way to do this, but you do this:

I’ll use vanyatwo as the user and app.example.net as the domain.

1. Copy the wildcard certificate for app.example.net to a temporary directory and rename the files to example1.app.example.net.*

mkdir -p /tmp/example1/
for ext in ca crt key; do cp /usr/local/hestia/data/users/vanyatwo/ssl/app.example.net.$ext /tmp/example1/example1.app.example.net.$ext; done

2.- Add the certificate to your domain.

v-add-web-domain-ssl vanyatwo example1.app.example.net /tmp/example1 '' yes

Once the wildcard certificate has been renewed, you must follow the same steps, but instead of using v-add-web-domain-ssl, you should use v-update-web-domain-ssl.

mkdir -p /tmp/example1/
for ext in ca crt key; do cp /usr/local/hestia/data/users/vanyatwo/ssl/app.example.net.$ext /tmp/example1/example1.app.example.net.$ext; done
v-update-web-domain-ssl vanyatwo example1.app.example.net /tmp/example1 yes

Since this is a manual process, you can create a script to automate the update after the wildcard certificate is renewed.

2 Likes

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