How to create a Let's encrypt cert under the domain whose doc root has changed

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.4
Virtualmin version 1.994

I did the following:
(domain name is an example)

Virtualmin ->Server Configuration → SSL Certificate → Let’s Encrypt
Request certificate for → Domain names listed here (example.jp, www.example.jp)
Request Certificate

Requesting a certificate for example.jp, www.example.jp from Let’s Encrypt …
… request failed : Web-based validation failed :

This program always tries to make a temp file in /home/example/public_html directory, but I changed the document root to /home/example/www. The site is running so I can’t change the doc root to default.

Is there a way to create a cert using Virtualmin panel under the conditon above?

One way which I can think of is for you to temporarily change the doc root back to default, get your SSL certificate from Let’s Encrypt and change it back again to /home/example/www.

There is an unavoidable 5 min of downtime but it is a quick and dirty solution and it gives you a three month window - till the next renewal of the SSL certificate - to figure out a proper solution by editing your .htaccess appropriately for example.

Thank you for your reply.

One way which I can think of is for you to temporarily change the doc root back to default, get your SSL certificate from Let’s Encrypt and change it back again to /home/example/www.

I also considered that way, but I’ll have to do the same thing for each renewal period, so this time I’ll use another certificate.
I hope Virtualmin supports irregular document root when creating Let’s encrypt cert in the near future.

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