httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid...@pidster.com>
Subject Re: [users@httpd] (again) Can not define "default" name virtual host
Date Tue, 27 Jun 2006 09:22:30 GMT


Matus UHLAR - fantomas wrote:
> On 27.06.06 09:34, Pid wrote:
>> Matus UHLAR - fantomas wrote:
>>> On 26.06.06 16:45, Pid wrote:
>>>> It maps there because it's the first in the list.
>>> Pardon? My problem is that request for "195.168.3.66" goes to
>>> "default.fantomas.sk" although "195.168.3.66" has its own virtual host.
>> Yes, I was quite clear on that and I think that I've offered a solution.
>>
>> I think that the server is not resolving the IP to the ServerName you
>> specify, because you are specifying the IP in the VirtualHost directive.
> 
> afaik the server does not resolve IP's to hosts here (do you have other
> informations?)

I didn't say anything about *DNS* resolution.

>> Instead, because it can't match VirtualHost it's selecting the default
>> VirtualHost, which is always the first one defined in the list of
>> VirtualHosts.
> 
> requests for "195.168.3.66" should go to virtualhost "195.168.3.66" if they
> come to the same address the virtual host is defined at, afaik no DNS
> resolution applies here.

Yes, you're probably right. But it doesn't, for reasons which I can only
guess at.

> The only place where DNS resolution applies, is where I define:
> 
> <VirtualHost fantomas.fantomas.sk:80>     <--- here
> ServerName 195.168.3.66
> DocumentRoot /home/webs/195.168.3.66
> </VirtualHost>

Umm, wha?

> in which case I can't have virtual host for "fantomas.fantomas.sk" because
> it would fall into this one :-(

You didn't say that, you said:

<VirtualHost 195.168.3.66:80>
ServerName default.fantomas.sk
DocumentRoot /home/webs/default.fantomas.sk
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName fantomas.fantomas.sk
DocumentRoot /home/webs/fantomas.fantomas.sk
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName 195.168.3.66
DocumentRoot /home/webs/195.168.3.66
</VirtualHost>


>> Ergo, your solution is to move the VirtualHost with 'ServerName
>> 195.168.3.66' to the first position in the list of VirtualHosts.

And I'm suggesting that the following will resolve your problem.

<VirtualHost 195.168.3.66:80>
ServerName 195.168.3.66
DocumentRoot /home/webs/195.168.3.66
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName default.fantomas.sk
DocumentRoot /home/webs/default.fantomas.sk
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName fantomas.fantomas.sk
DocumentRoot /home/webs/fantomas.fantomas.sk
</VirtualHost>



> That would mean that requests for "195.168.3.66" would go to the default
> virtual host which is also what I do not want.



>> Alternatively, if you specify NameVirtualHost *:80 and use VirtualHost
>> *:80 the 'ServerName 195.168.3.66' should properly select the correct
>> host.  If you are operating different IPs tell this instance of Apache
>> to only Listen to this IP.
> 
> and run different apache instances on different IPs? Yes, both would be a
> workaround, but I would prefer a solution.
> 
> I looked at the code to find out what's wrong, but I am not a programmer
> (although I can code in C, it's not my work so I have nearly no practice).
> 
> I would patch apache myself if I found the solution... this makes me a
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message