Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.