All Domains open the Default website page instead of the URL requested

6 posts / 0 new
Last post
#1 Tue, 04/08/2014 - 16:01
mark.a.satterfi...

All Domains open the Default website page instead of the URL requested

Okay, here goes. I've searched the web and found references to the issue, but can't fix with the referenced documents.

Problem: All domains open the same "Default website for IP address" (henceforth called "Default website...") virtual server.

Operating system Debian Linux 7; Webmin version 1.680; Virtualmin version 4.06.gpl GPL; Theme version 8.7

  1. Changing the "Default website..." in the Server Configuration -> Website Options changes the website that is displayed.

  2. The access_log/error_log entries always show up on the "Default website..." files.

  3. The access_log/error_log entries always show the domain name that was requested, not the "Default website..." domain.

So this seems like it means the FQDN is being passed to Apache correctly, and the Apache system is handing the "default website..." incorrectly, no?

So what am I missing? What do I need to configure or unconfigure?

http://www.marksatterfield.com

Tue, 04/08/2014 - 17:31
andreychek

Howdy,

That could be the result of an IP Address mismatch in Apache... there's some troubleshooting steps for that problem in the section "The wrong website shows up" at this URL:

https://www.virtualmin.com/documentation/web/troubleshooting

Wed, 04/16/2014 - 13:40 (Reply to #2)
mark.a.satterfi...

Thank you Andreychek! I did see that link before posting, and here's the results. I broke it up into sections, to mirror the suggested ideas in the document you linked to.

No NAT. Skipped this section.

ifconfig v web site IP addresses

ifconfig

root@blackseam:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:89:2f:ad inet addr:162.244.24.29 Bcast:162.244.24.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe89:2fad/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1625849 errors:0 dropped:17911 overruns:0 frame:0 TX packets:853295 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:175946827 (167.7 MiB) TX bytes:151734940 (144.7 MiB)

Then I grepped all the Virtual Host IP addresses like this:

grep "<VirtualHost" /etc/apache2/sites-enabled/*

root@blackseam:~# grep "<VirtualHost" /etc/apache2/sites-enabled/* /etc/apache2/sites-enabled/000-default: /etc/apache2/sites-enabled/blackseam-com.conf: /etc/apache2/sites-enabled/blackseam-tk.conf: /etc/apache2/sites-enabled/marksatterfield-tk.conf:

They all show up as the same IP address, 162.244.24.29 ... except the first one, which shows up as

/etc/apache2/sites-enabled/000-default:

I looked into the 000-default a little, and the Directory is the /var/www/ directory. It is not the web page that shows up. The web page that shows up is whatever I select as "default" within Virtualmin, and I can change it to whichever of the three that I have registered.

Per the link you provided, "You would want to make sure that IP address is your server's primary IP."

All of the IP addresses are the same as the server's primary IP address None of the IP addresses list an asterisk

Network interface for virtual addresses - This is automatically detected by Virtualmin during the configuration check, but could be detected incorrectly, if you have multiple physical interfaces, or your system is some virtualized system like a vserver or Zone or OpenVZ instance. You would typically want this to be the primary IP address of your server -- in most cases that is "eth0".

My host is some kind of virtualized server, but I don't know which one. That said, eth0 is the one that shows up for ifconfig, so I think it is okay.

eth0 Link encap:Ethernet HWaddr 00:50:56:89:2f:ad inet addr:162.244.24.29 Bcast:162.244.24.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe89:2fad/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1625849 errors:0 dropped:17911 overruns:0 frame:0 TX packets:853295 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:175946827 (167.7 MiB) TX bytes:151734940 (144.7 MiB)

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:191652 errors:0 dropped:0 overruns:0 frame:0 TX packets:191652 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:21988638 (20.9 MiB) TX bytes:21988638 (20.9 MiB)

Any other ideas? thanks so much for the assistance so far.

~~ Mark

http://www.marksatterfield.com

Wed, 01/11/2017 - 10:41 (Reply to #3)
hbdp

Thanks andreychek, your answer helped me solve my issue

Wed, 04/16/2014 - 13:46
mark.a.satterfi...

I reposted this in the VirtualMin section. Although I'm a newbie, I don't think this is a newbie qualified question.

For updates, see

https://www.virtualmin.com/node/32957

Wed, 05/14/2014 - 10:17
mark.a.satterfi...

Okay, as one may expect, operator error.

Short answer: Confirm that the domain name is exactly the name of the domain that is referenced, including dots and dashes.

Longer answer:

Because I will be hosting .coms, .nets, and other tlds -- some of which would be the same base name -- I thought it would be clever to identify the name as "example-com" and "example-net", etc. The way the system normally works is if example.com is entered, the username is just example. I considered, what would happen with the .net, et al, since the username example would already be used.

Not a good idea.

The domain name has to be exactly the name that is referenced. Then you can change the username associated with that domain. For example:

Domain: example.com; User example-com Domain: example.au; User example-au

Hope this helps someone.

Topic locked