Sub-server displaying content of parent server on shared external IP address [SOLVED]


I cannot find out why the sub-server is not displaying the content of its public_html directory but instead the content of the parent server’s public_html. Both servers are using a external shared IP address.

Here is my setup (not with the real IPs and domain names though…), in chronological order:

  1. installed 'webmin / virtualmin gpl' on my dedicated server (debian jessie)
  2. bought IP external addresses (from 'ovh') and installed them manually by editing the /etc/network/interface file (following ovh documentation:
  3. created the parent virtual server:
    • domain name:
    • administrative user: examplecom
    • features: apache website and webmin access (no ssl, no mail related feature, no dns)
    • document root: /home/examplecom
    • files for the website in /home/examplecom/public_html/
    • IP address, already active, external IP address, already active, no ipv6 address
  4. uploaded the index.html file containing this is in /home/examplecom/public_html/
  5. on my registrar, setup the DNS of to point to
  6. when I visit, it works fine, I can see this is
  7. shared the IP (Server Configuration > Change IP address, click on Convert Private Address to Shared)
  8. created the sub-server of
    • domain name:
    • server configuration template settings for sub-servers
    • parent server: (examplecom)
    • administrative user: examplecom
    • enabled features: apache website and webmin access (no ssl, no mail related feature, no dns)
    • IP address shared on non default IP , external IP address, no ipv6 address
  9. uploaded the index.html file containing this is in /home/examplecom/domains/
  10. on my registrar, setup the DNS of to point to

The problem is that when I visit, I see this is and not this is

What am I doing wrong?

hi, I can see, however no word to mention distro you are using, also are you business ?

I’m using debian jessie, if it is what you were asking. Sorry but I don’t understand your question ‘are you business?’

Any idea what is missing in my configuration, that would explain why it is not working?

hi hbdp, was just curios if that server sits on residential line or business line. difference is dynamic vs static ip, thats all. In your case you using business line (static ip from your hosting provider …i missed that fact). I would suggest to check bind settings for that host (zone). I’ve seen that someone had this issue in past in this forums but I do not remember the link. Also did you try to contact ovh support staff?

Thank you very much for your help, unborn.

The thing is that the requests to do reach the server but I noticed that they don’t appear in’s apache access logs but in’s access logs, so it looks like the IP setup is correct.

I haven’t touched anything concerning the DNS settings, I thought that adding a sub-server will have virtualmin setup everything automatically so that the requests from are directed to its document root’s public_html.

Maybe I should change the options I used for creating the sub-server?

Oh and regarding DNS, I forgot to mention that I intentionnally didn’t select the feature DNS domain enabled? when creating both and

So far I haven’t needed to setup DNS on the server as I got all my domains (hosted on their own external IPs) working by simply editing the DNS on the side of the registrar, where I bought the domain, and setting them to point to the corresponding external IP address.

I actually find a solution to my problem thanks to this answer to a similar problem, which was pointing to Virtualmin’s website troubleshooting documentation.

I did the following:

  1. Logged as root with ssh

  2. Listed the IP addresses on the server
    # /sbin/ifconfig

  3. check what IP addresses apache is expecting and for which domain
    # grep -i ‘<virtualhost’ /etc/apache2/sites-enabled/*.conf

  4. I got this for

/etc/apache2/sites-enabled/<VirtualHost *:80>

  1. I edited /etc/apache2/sites-enabled/ by replacing
    <VirtualHost *:80> with

  2. I restarted apache2
    # service apache2 restart

I visited, and tadaaaa I saw this is

Hope it can help someone in the same situation as me.

Hi hbdp, sorry for late reply but I’ve managed to spill out my soup on laptop resulting me to strip laptop down and clean up the keyboard. Since I do run Debian my self everywhere not just servers for sure I would say on proper debian setup - on server you should not need to do those things…its should do this automatic for you. - Did you modify any other settings on your server? coz thats just crazy…

Check the IP addresses assigned to each VirtualHost in the Apache configuration. This can be caused by one having

And the other having:

This leads to weird behavior as Apache decides what to display (it’ll end up showing the “default” site, I think). I’ve asked Jamie to make this harder to have happen accidentally in Virtualmin. It’s a common question. There’s an entry in the troubleshooting docs about it here:

…you only need to do this when you have external dns… but if you manage dns with bind on your server it will work with <VirtualHost *:80>

Hi unborn,

sorry to hear that. Hope your laptop is still alive… I heard some people say “Never eat next to your computer, period”, though I agree it’s quite a discipline (that I don’t have myself yet…) :slight_smile:

Anyway, I just installed webmin following a tutorial from digital ocean, nothing fancy.

For the installation wizard I basically skipped anything that was not related to apache, because I wanted to have it running as soon as possible and I don’t need neither mail nor DNS nor MySQL, nor anything else…

I wanted to have it just serving static or dynamic (php) content. Plus the DNS configuration have been done on the side of the registrars, simply pointing to the allocated IPs.

So far it has been working good, because I could install new IPs, which I purchased from ovh, my hosting company and I could assign single virtual servers / domains to each of them.

That’s only when I wanted to have multiple domains on the same external IP, that I encountered this issue with sub-server content not being displayed but parent content instead.

Any idea where I could edit my config so that the correct IP is assigned by apache on sub-server creation?

I checked the apache configuration and the sub-server template but I didn’t see anything that I could edit and that would have that wildcard replaced by the actual shared IP in the sub-server apache configuration file.

Moreover, I’m wondering if it does not come from the fact that I installed the new IPs using the guidelines of ovh, and not through the webmin interface.

Maybe I should be using the webmin interface and share the new external IP address I purchase from the beginning and that could help (althought it could be a bit tedious to add them one by one in the webmin interface)?

By the way, I’m also a big fan of debian myself, hence the choice of the distro… :wink:

Thank you Joe.

Indeed that’s how I solved the problem, by replacing the widcard in the apache configuration file by the correct shared IP address.

But as unborn mentionned, it is a bit weird that it has to be done like this. That’s the point of Webmin / Virtualmin, to have this kind of things abstracted and done for us. So it looks like it could be a configuration thing that is not or incorrectly setup on my server.

Hello again unborn,

but isn’t it my case, though? My DNS are not managed by Webmin, I just edit the server IP address on my registrar for the given domain. Could it be the reason why I get <VirtualHost *:80> in the sub-server apache configuration file?

Althought that seems quite weird because I specify the shared IP address when creating the sub-server…

hi hbdp, you do not feel weird regards this… its normal… If you do not manage dns on you own then you should expect some ugly things…(edit - you should tell people in this forums asap… it makes a sense) nothing to worry about but just - you should see it as sysadmin… its all resolved inst it?