Matus UHLAR - fantomas wrote: > On 27.06.06 13:30, Neil A. Hillard wrote: >> I don't understand what the problem is here. I've tested the >> configuration suggested and it works fine (OK, I had to change the IP >> address to match my setup): >> >> <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> > > The problem is, that "default.fantomas.sk" does not exist: > > Host default.fantomas.sk not found: 3(NXDOMAIN) > > It has to be default name virtual host on this IP - the catch-all for all > hosts not defined not listed in config file (e.g. nosuchserver.fantomas.sk > or nosuchserver.apache.org): > > 1151413212 default.fantomas.sk nosuchserver.fantomas.sk - nosuchserver.fantomas.sk 195.168.3.66 fantomas.fantomas.sk 200 20 5 - "/" "-" "-" > 1151413489 default.fantomas.sk nosuchserver.apache.org - nosuchserver.apache.org 195.168.3.66 fantomas.fantomas.sk 200 20 4 - "/" "-" "-" > > this is the log format: > %{%s}t %v %V %{Host}o %{Host}i %a %h %>s %b %T %u \"%U\" \"%{Referer}i\" \"%{User-Agent}i\"" > > The reply has to be like "No server is configured at this address", while > reply for "195.168.3.66" should be the std. page I configured. > The problem currently is, request for 195.168.3.66 falls here :( > >> You have made sure you've got a NameVirtualHost 195.168.3.66:80 set? > > Yes. > >> When not supplying a 'Host:' header or supplying the IP address in the >> 'Host:' header then Apache responds using the first virtual server but >> if the name 'default.fantomas.sk' is used then the second one is used. > > Yes. > > But nobody should request "default.fantomas.sk" (except me and other people > looking at this problem). People may put 195.168.3.66 into their browser and > get to virtual host for 195.168.3.66 - I make this server for people unable > to use DNS resolution. > > But if anybody points any hostname to 195.168.3.66, it should go to > "default.fantomas.sk" (actually I can use any other name except > fantomas.fantomas.sk/195.168.3.66) and tell people "go away, the server you > asked for does not exist". > > The pages you pointed me at (and also their 1.3 equivalent) say: > > <CITE> > Now when a request arrives, the server will first check if it is using an IP > address that matches the NameVirtualHost. If it is, then it will look at > each <VirtualHost> section with a matching IP address and try to find one > ^^^^^^^^^^^^^^^^^^^ > where the ServerName or ServerAlias matches the requested hostname. If it > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > finds one, then it uses the configuration for that server. If no matching > virtual host is found, then the first listed virtual host that matches the > IP address will be used. > </CITE> The "matching IP address" you refer to is NOT in the ServerName directive it's in the VirtualHost definition*. The documentation is clear. You are misinterpreting the documentation, and you are just plain WRONG. *Here: <VirtualHost MATCHING_IP:PORT> NOT here: ServerName FQDN:PORT > They only say, that the requested host name should match ServerName and > ServerAlias. But, when the name provided in <VirtualHost> matches the name > requested, the virtual host matches too. > --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx