Bug 11890 - incorrect virtual host called
Summary: incorrect virtual host called
Status: CLOSED WORKSFORME
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: core (show other bugs)
Version: 1.3.26
Hardware: All FreeBSD
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
: 11889 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-21 10:06 UTC by Matus "fantomas" Uhlar
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matus "fantomas" Uhlar 2002-08-21 10:06:56 UTC
cut from my config file:

---

NameVirtualHost home.nextra.sk

<VirtualHost home.nextra.sk>
ServerName default.nextra.sk
DocumentRoot /clients/www/default.nextra.sk   
Alias /icons/ /usr/local/www/icons/
</VirtualHost>

<VirtualHost home.nextra.sk>
ServerName home.nextra.sk
DocumentRoot /clients/www/home.nextra.sk
Options FollowSymLinks
</VirtualHost>

---

when trying to get root for home.nextra.sk, i always get default.nextra.sk
protocols http/1.0 and http/1.1 tried, both return incorrect info.
in logs I also see that default.nextra.sk was accessed.
Comment 1 Matus "fantomas" Uhlar 2002-08-21 10:08:19 UTC
*** Bug 11889 has been marked as a duplicate of this bug. ***
Comment 2 Joshua Slive 2002-08-21 14:02:20 UTC
Those two hosts return different content for me.  (You can only tell by looking
at the <title>.)

In any case, this is a question better addressed to a user support forum like
the Apache Users mailing list.
Comment 3 Matus "fantomas" Uhlar 2002-08-22 14:49:02 UTC
Well, if you checked home.nextra.sk, those return 2 different hosts because I
changed order they are defined in. I want the vhost 'default.nextra.sk' catch
all   requests for hosts not defined in config file, and 'home.nextra.sk' to
catch only if client really requests 'home.nextra.sk'. I changed the order
because this incorrect behaviour makes problems to me.

but if I define 'default.nextra.sk' BEFORE 'home.nextra.sk' in config, then
'default.nextra.sk' will catch even requests for 'home.nextra.sk' which is not
acceptable.
Comment 4 Matus "fantomas" Uhlar 2002-08-22 15:03:37 UTC
btw, iwasalready talking about this in mailinglist:
http://marc.theaimsgroup.com/?l=apache-httpd-users&m=102709024510046&w=2
the recommendations I got were:
- use <Virtualhost IP>
- use <VirtualHost *>

which are both inacceptable by me. And, I suppose this is a real bug, unless
I'll get proper explanation why apache has this behaviour (better: why should it
have this behaviour). Thank you and sorry for not mentioning I will change the
config to work.
Comment 5 Joshua Slive 2002-08-22 15:54:24 UTC
Please try again on the mailing list.  Many thousands of people have
name-virtual-hosts
working correctly, so it is very likely not a bug.  When you post, it is best
if you have your site configured in the way that is not working so others
can effectively test it.  Also, you never answered the question of why
you aren't using "NameVirtualHost *" and "<VirtualHost *>".
Saying that the correct configuration is "not acceptable" doesn't help.

If I had to guess about your problem, I would say it is caused by the fact
that those hostnames resolve to multiple IP addresses, which could
significantly confuse apache when it must resolve the IP addresses
in the NameVirtualHost and <VirtualHost> directives.  That is one of
the reasons why using hostnames in those directives is not recommended.

Sorry I can't help you further here, but the bug database is not the place to
deal with support questions.
Comment 6 Matus "fantomas" Uhlar 2003-03-13 15:43:03 UTC
Well, I tried it but nobody helped me. Anyway I got a zillion answers of type
"do it another way".
I take it as 'a bug which nobody wants to see/resolve'
I'll send you patch if I'll do it.