SSL certificate for subserver not working with subdomain

SYSTEM INFORMATION
OS type and version debian 13
Webmin version 2.6
Virtualmin version 7.50.0 GPL

Hello,
I am trying to use a lets encrypt certificate for a subserver in virtualmin. This subserver also has a subdomain, and I only request the certificate for the subdomain. The certificate request works fine, I can see my certificate in “SSL Certificate” page.
If I try to load the domain of the sub-server it says the certificate is for subserver subdomain (fine). But when I try to load my web site using the subdomain it says it’s invalid, and it shows me the certificate from the main server, instead of subserver subdomain.

main server : celeos.fr
subserver domain : mains-sages.org
subdomain in the subserver : permaculture.mains-sages.org

I’ve been able to workaround by renaming my subserver domain name with my subdomain name. But now I have the the opposite problem. When I try to load the domain mains-sages.org it tries to use the main server certificate instead of the subserver domain.
Should I create 2 subservers ? One with and one without subdomain ?
In a previous version of virtualmin I did not have to do that.

OK. I’m getting a head ache here. :wink:
Without knowing the content and what you are trying to do, my strategy here would be

Server:  celeos.fr
Server:  mains-sages.org
  sub-server:  permaculture.mains-sages.org

This presumes that celeos.fr is independent of mains-sages.org in content. If not I think you might want to look at aliases instead? Not my area of expertise. My sub-servers all point to a docker container so it is a little more interesting. I had to proxy it so that’s why I went with a sub-server. At one point one browser complained that the images from the docker container weren’t secure. All the ssl is done at the server level.

my subservers share the same database and wordpress files (same public_html folder), but their websites are independant (wordpress multisite)
So I can’t make 2 independent servers as you suggest, but I am not sure alias could apply to this case ?

I have NO clue on how WP multi site works. With Discourse multi site using a Docker container I have independent sites that I proxy to the container. I put the domain on a server and the forum.xyz.xxx on a sub server of that server for the proxy stuff. Discourse does the rest.

I don’t know if the Pro version WordPress Bench would do this. It seems to me that if WP has a multi site option they would have some method of handling this? But good luck. I was having trouble wrapping my head around the what and why of what you were doing but at least it is a little clearer to me what you are doing.

I did more testing, and I could create aliases from my main server, it works fine with WP multisite.
The downsides are : I can’t get awstat reporting per domain name. I also can’t configure php settings and php fpm pools per domain name.
But I guess I would save resources to have only one apache/php pool for the whole multisite, instead of one for each subsite.
Because I have another network with 15 subsites and it can make a difference

1 Like

So many pieces to the puzzle. :wink: