default domain not correct one

Hi.

I noticed this a few minutes ago.

If someone points an a domain to one of my virtualmin server's ip and the domain doesn't exist... The wrong domain is showing.

How can I tell virtualmin to show domain X instead of domain Y?

Thanks

Marc

Status: 
Closed (fixed)

Comments

edit for subscription

Usually, if no other circumstances require further configuration, you can achieve that by setting the option Server Configuration -> Website Options : Default website for IP address of the desired domain to Yes.

Internally, VMin will then rename the Apache configuration file for the VServer in question so that it is alphabetically the first file to be parsed, thus making it the default for unknown host names for Apache.

You might want to try that first, and if the wrong domain is still shown, check back here for further help. :)

Ha!

That's the problem.

How can I duplicate this for another ip for which the server doesn't have any websites configured? There is no dropdownbox allowing to set defaut domain for all IPs.

Unless I misread something.

Can you confirm?

Regards

Marc

Oups... there must be something wrong!

both domains abcdetails.ca and contacti.ca are set this way... as default domain for this ip.

Changing one doesn't change the other.

I have sent you remote login privileges for you to check what I say.

regards

Marc

"abcdetails.ca" does not seem to have valid public nameserver entries... The root servers for ".ca" give me NXDOMAIN. "contacti.ca" resolves to 74.84.136.116.

Do those two sites by chance have different IPs of your host assigned? The "default domain for this IP" is, as the name implies, per-IP. :) Thus you can have multiple VServers with that property assigned.

It is possible though, through direct Apache configuration, to define one virtual host as default for all IPs. I haven't played around with that yet myself though, since my server VMs usually only have one IP assigned.

If you feel in an "experimenting" mood, I can suggest reading the Apache documentation concerning virtual hosts and virtual host matching, and then playing around with the Webmin Apache module.

http://httpd.apache.org/docs/2.2/en/vhosts/
http://httpd.apache.org/docs/2.2/en/vhosts/examples.html
http://httpd.apache.org/docs/2.2/en/vhosts/details.html

"Remote login privileges"? Where did you send those? I should note that I'm not a member of the developer team here, but just a user like you. ;)

Hi.

Those 2 domains are on the same ip indeed.

abcdetails says default domain for ip yes contacti says default domain for ip no default to contacti

I can't seem to get the logic here.

Marc

ARG!!!

I changed the default domain to another.

Contacti now says the other domain is default but abcdetails refuses to relinquish it's wrong default place.

This is bizare!

I need help!

I can see what you mean. :) I'm playing around a bit with this feature right now, and am also getting some weird "discrepancies" about what VMin considers the current default domain.

It's possibly related to "parsing problems" concerning the files and links in Apache's site configuration directories. Am still doing experiments, but can you check and list the contents of /etc/apache2/sites-available (containing the actual domain config files) and of /etc/apache2/sites-enabled (containing links to the former), and also make a list which link points to which config file? And match what you see there to what VMin thinks is the default domain.

Also, did you get any Apache errors at any point when you switched the default domain around in VMin?

Further info: After what I've seen so far, to make a domain the default, VMin will rename the config and the link file and prepend "0-" to the name, thus making it the alphabetically first in the list. I've had it happen (unfortunately can't reproduce the steps that led to it though) that a domain was named "0-0-domain.tld" after some fiddling. That is sure bound to confuse VMin later. :)

No errors were reported when I applied the setting.

I am still left with 2 domains being default website for ip address without the possibility to edit any settings. It just says yes without any option to set/edit.

I am troubled.

Anoyone in the virtualmin team can tell me how to remove the wrong domain from being default?

Regards

Marc

Did you check the two directories I named? As far as I can tell from my experiments so far, the naming scheme of the config files that I mentioned is what VMin uses to consider a domain "default or not".

I have no such /etc/apache2 dirs... and there are no conf files for domains in /etc/httpd

I am running centos 5.5 maybe it has to do with that.

I am getting a little stressed.

Yeah, for CentOS, all the VirtualHost information goes into the main Apache config, /etc/httpd/conf/httpd.conf.

I'm not sure I followed everything you guys went over, but the default website is generally configured via the "Default website for IP address" option that Locutus mentioned.

However, all that does is change the position of the VirtualHost configuration for that particular domain, making it first.

If that's not working for some reason, I can manually reorder the domains in your httpd.conf file so that the correct domain shows up as the default.

Which domain should be the default?

Okay, the CentOS information was a relevant bit. :) CentOS seems to have a quite different setup for the Apache config files than Ubuntu which I use.

I'll leave this for the development team then... Hope you get it fixed! Good luck!

Thanks anyways Locutus of Borg.

I have opened a ticket with the support team.