These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Sub-server displaying content of parent server on shared external IP address [SOLVED] on the new forum.
hi, I can see, however no word to mention distro you are using, also are you business ?
Configuring/troubleshooting Debian servers is always great fun
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?
Configuring/troubleshooting Debian servers is always great fun
Thank you very much for your help, unborn.
The thing is that the requests to
otherdomain.com
do reach the server but I noticed that they don't appear inothercomain.com
's apache access logs but inexample.com
'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
otherdomain.com
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 bothexample.com
andotherdomain.com
.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:
Logged as root with ssh
Listed the IP addresses on the server
# /sbin/ifconfig
check what IP addresses apache is expecting and for which domain
# grep -i '<virtualhost' /etc/apache2/sites-enabled/*.conf
I got this for
otherdomain.com
/etc/apache2/sites-enabled/otherdomain.com.conf:<VirtualHost *:80>
I edited
/etc/apache2/sites-enabled/otherdomain.com.conf
by replacing<VirtualHost *:80>
with<VirtualHost www.xxx.yyy.zzz:80>
I restarted apache2
# service apache2 restart
I visited
http://otherdomain.com
, and tadaaaa I sawthis is otherdomain.com
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..
Configuring/troubleshooting Debian servers is always great fun
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...) :)
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... ;)
Check the IP addresses assigned to each VirtualHost in the Apache configuration. This can be caused by one having
<VirtualHost *:80>
And the other having:
<VirtualHost 192.168.1.1:80>
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: https://www.virtualmin.com/documentation/web/troubleshooting#toc-the-wro...
--
Check out the forum guidelines!
....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>
Configuring/troubleshooting Debian servers is always great fun
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?
Configuring/troubleshooting Debian servers is always great fun
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.