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.
*** Bug 11889 has been marked as a duplicate of this bug. ***
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.
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.
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.
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.
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.