0

I managed to configure this very nicely under cPanel/WHM, but I am having trouble configuring it under Virtualmin: when I create a new Virtual Server in Virtualmin, I want it to automatically create an Apache with a subdomain of a shared wildcard SSL domain. So for example, if I create a virtual server for some.example.com, I want two VirtualHosts:

<VirtualHost 1.2.3.4:80>
    ServerName some.example.com
    ServerAlias www.some.example.com some_example.shared-ssl-domain.com
    ...
</VirtualHost>
<VirtualHost 1.2.3.4:443>
    ServerName some_example.shared-ssl-domain.com
    ...
    SSLEngine on
    SSLCertificateFile /path/to/shared-ssl-domain.com.crt
    SSLCertificateKeyFile //path/to/shared-ssl-domain.com.key
    SSLCACertificateFile /path/to/shared-ssl-domain.com.cabundle
</VirtualHost>

in cPanel/WHM I was able to do this easily because the template file contained the <VirtualHost> and </VirtualHost> directives. But Virtualmin's template does now. is there any way I can set up Virtualmin to do what I want?

Josh
  • 9,001
  • 27
  • 78
  • 124

1 Answers1

0

I ended up creating a Ruby script which I configured to be run as a hander after any changes are made to a virtual server. The guts of the script are available as an answer to this question, but what it basically does is locate the VirtualHost file for the given domain, find all the directives inside the <VirtualHost> tag, and copy them to a new <Virtualhost> tag configured to use the wildcard cert.

Josh
  • 9,001
  • 27
  • 78
  • 124