View Single Post

  #1 (permalink)  
Old 02-16-2007
forrie@gmail.com
 
Posts: n/a
Default VirtualHost odd behavior (inconsistent?) Apache-2.2

I've set up apache-2.2 on SunOS 5.10, and have a fairly basic
configuration that involves 2 NameVirutalHosts, and a _default_
definition.

What I'm seeing is odd, as it doesn't seem to coincide with the
documentation - therefore, I can only assume this is "user
error" (grin).

_default_:80

Should catch anything coming to the machine that is NOT DEFINED, such
as just coming to port 80 via IP address.

<VirtualHost host-name1.domain.com>

<VirtualHost host-name2.domain.com>

are basic entries, nothing special.

NameVirtualHost xx.xx.xx.xx

and have tried

NameVirtualHost *:80

I'm using the latter at this point.

Now: when I connect to this system via IP address, instead of going
to the _default_ location (DocumentRoot goes to the same path as host-
name1), I end up at host-name2.

If I take that out, it will work.

However, if I put in:

Listen xx.xx.xx.xx:80

That breaks it, which makes no sense to me. So I just leave it as:

Listen 80

which works.

I've tried mixing around using IP virtual hosts and name-based...
still get odd results.

I've followed the documentation on apache.org.

To ensure that the _default_ definition appears "first", I placed that
in the main httpd.conf file *before* the Include for the vhosts. So
that isn't the issue.

Anyone see this before? I'm stumped. I know what I have now
(without _default_) is working, but I'm still suspicious and it's not
100% of what I need, so I want to figure it out.

I won't spam the group with my *.conf details here - will send under
separate cover if someone wants to see it. I've also considered
whether this behavior might be due to a Module (or lack thereof), and
I cannot tell yet.

Thanks.