New virtualhosts with SSL enabled being assigned shared IP for itself (breaks other sites)


I just started using Virtualmin last week and it’s absolutely great - has saved me so much trouble! Thank you to the team who is responsible for it, it’s amazing.

I am running Debian 8.4 on my server. Within Virtualmin, whenever I create a new website with SSL enabled, I have noticed the configuration file for the virtualhost within /etc/apache2/sites-available always sets the VirtualHost for port 443 to the shared IP address of the server rather than a wildcard. This results in every other domain trying to present that particular SSL certificate which of course results in a certificate mismatch error.

As a result of this, every time I create a new virtualhost, I am having to log in to SSH to modify the configuration file, so it shows this:

<VirtualHost *:443>

…instead of…

<VirtualHost X.X.X.X:443>

Is there any way I can get Virtualmin to do this for me automatically each time I create a virtualhost? It’s a bit of a pain having to do it each time myself.

Thank you.


Just to clarify, are you saying there are other existing SSL websites that are breaking when this happens?

It’s actually normal that it would add the VirtualHost line with the IP address – but it shouldn’t ever break anything to do so.

If it is, what you may want to do is ensure that all other VirtualHost lines in /etc/apache2/sites-enabled/*.conf are also using the IP address. If there’s a mix of styles, that could cause some unusual problems.


Hi Eric,

Thanks for your reply. I hadn’t thought of that - I’ll give it a try and let you know.



Just to update - it worked. Thank you.