Virtualmin validation fails when SSL cert and private key are not in home folder

Maybe I'm missing something so please tell me if I am. I decided wanted to put SSL certs, keys, etc in a sub-folder within the user's home directory. So I set the template paths in Virtualmin's configuration to the desired subfolder(~/private/ssl.key, etc). I then went into my virtual servers "Configure Website for SSL" and changed the path under SSL Options and moved the files to the newly created private subfolder. Apache functions well but Virtualmin fails validation outputing "SSL website : The SSL certificate for this virtual server does not match mydomain.com or www.mydomain.com. Instead, it matches the hostnames :" When I go to the virtual servers "Manage SSL Certificate," virtualmin states I have a self signed cert installed. So I reinstalled the certificate, but Virtualmin recreated the files in the home directory's root instead of in the subfolder I set in the configuration.

Is this a bug or am I missing something somewhere?

Thanks, Alan

Status: 
Closed (fixed)

Comments

Yes, you have to also update Virtualmin's own per-domain database that stores the SSL certificate location.

The steps to do this are :

  1. SSH into your system as root
  2. Get the domain's unique ID with the command virtualmin list-domains --domain tableworksusa.com --id-only
  3. Edit the file under /etc/webmin/virtual-server/domains whose name is that ID
  4. Find the ssl_cert and ssl_key lines, and change the path to reference the private directory.
  5. Save the file.

In future, you shouldn't move the cert for existing domains .. but updating the template will apply to all domains created from then on.

Automatically closed -- issue fixed for 2 weeks with no activity.