RE: [users@httpd] Debugging virtual hosts?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Steve Swift [mailto:steve.j.swift@xxxxxxxxx] 
> Sent: Thursday, September 14, 2006 8:59 AM
> To: users@xxxxxxxxxxxxxxxx
> Subject: Re: [users@httpd] Debugging virtual hosts?
> 
> I know of no way to trace the mechanism that Virtual Hosts 
> uses, but from observation of several working systems, and 
> close scrutiny of the documentation, it goes mostly like this:

Steve's response is right on the money; Just to clarify some points:

> 
> 1. Read the "NameVirtualHost xxx" directive to identify which 
> address/ports activate Virtual Hosts. 
>      On match, proceed to step 2.  In my case this is *:80 - 
> port 80 on any adapter.
> 2. Now look through the <VirtualHost xxx> directives. I'm not 
> sure if the xxx is matched against the xxx in the 
> NameVirtualHost directive or the interface/port in use. 

It is matched against the NameVirtualHost argument.

> Keep 
> them the same unless you know better! 
>     For each matching VirtualHost directive, see if the 
> included "ServerName" directive matches the server name from 
> the client (the users browser)

ie; the "Host" header in the request.

Incidentally, this is something to check; is your client really sending
a Host header? To do so, it must be using HTTP/1.1 (all modern browsers
do so). Please confirm that you are using a recent browser to test this
server.

If you are in doubt, try logging it (%{Host}i in CustomLog, see
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog)

I notice that your server has an IP address of 192.168.1.2, so it's a
LAN. Hence you must be behind a router or FW that connects you to the
internet. Are you sure that component is not removing headers from the
request?

Assuming not, are you sure that you are accurately transcribing the
hostnames from the browser to the server config (you already made one
typo on this...)

Finally, is this stuff really on the public internet or is it all on the
LAN? If so, are you sure DNS is working on the client machine (it's not
on the server - hence the warning when you start up).

It would be better if you wouldn't hide all the hostnames - we're not so
sure if this is a real error or some typo somewhere...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>    If the servername matches, then look no further... use 
> this virtual host 
>    If no servername matches in any virtualhost then use the 
> first virtualhost that matched the NameVirtualHost directive. 
>   You are most likely falling foul of this mechanism
> 
> 
> On 14/09/06, bwobbones <bwobbones@xxxxxxxxx> wrote:
> 
> 
> 	Thanks for the reply,
> 	
> 	  Sorry, a mis-communication.  I mean process as in a 
> series of steps.  I.e.
> 	is there some way of getting httpd to print out the 
> sequence of steps that
> 	it is using to determine which vhost to go to? 
> 	
> 
> 
> -- 
> Steve Swift
> http://www.swiftys.org.uk 
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux