Virtual Domain and host info in http request
From: Ohmster (donteven_at_thinkaboutit.com)
Date: 31 May 2004 18:07:47 GMT
As you know, if you had seen my previous pleas for help regarding virtual
hosts, I cannot get virtual hosts to work at all. From what I undertstand (I
am learning far more than I ever wanted to know about this, please forgive my
ignorance.), the way that name based virtual hosts works is that when a
browser makes an initial connection to a webserver, it sends host information
as to what the domain is that it is trying to reach, or that is how I
understand it to work.
Since my virtual host containers never work and all http requests get stuck
in the first virtual container, and I have tried like almost everything, I
decided to use ethereal to look into the headers that are arriving in my
machine, to see if there is any host information present. If the initial http
request does not mention the host that it is trying to reach, then name based
virtual hosts would fail, would it not?
I ran ethereal and tried to connect to my domain.com and to my family.org to
see what is in the headers. Ethereal is giving me a lot of info and it is
rough to sort out because even in such a short test of only a few seconds,
there is much to weed through. I sorted by destination and looked at incoming
packets to my machine.
Ethereal has a protcol column and there is much TCP protocol coming in and
some HTTP protocol coming in. The info lists this as protocol TCP with [SYN]
and [ACK]. There is some HTTP protocol as well.
Anything listed in the HTTP protocol to my machine is a GET request and this
does indeed show a host statement in the HTTP layer as "Host:
www.mydomain.com\r\n". The TCP layer shows the source port as 43860 and the
destination as port 80.
All of the HTTP GET request are for gif images and things of that nature, as
if one were loading a web page and were downloading the images on them. I
would think that a GET request is not the initial request and that this
request comes after the intial request has been made. In other words, the
host info comes too late to be of use to the virtual domains.
The TCP protocols seem to make the initial requests as in [SYN] or [ACK] but
there is no host information in these headers. Let's try a [SYN} packet and
see what is in there. We have Frame, Linux Cooked Capture, Internet Protocol,
and Transmission Control Protocol in there. Under Frame I see time and packet
size info. Under Linux Cooked I see packet type, link layer, source
<missing>, and protocol. TCP gives length, ID in hex, time to live,
checksums, destination, and source info as IPs. No mention of a host name in
So am I correct in that if I do not receive host info in my initial document
request to the server that I will not be able to use virtual hosts? Only the
http get request shows host info and by that time, the connection to the
apache server has been made and any chance of a virtual domain is lost?
To tell you the truth, I only ran the ethereal test for a few seconds and
caught 127 packets. I did hit my server on each domain during this test and I
cannot see those packets. Most all of the packets are for my friend's
stationary website from his userdir, but still, they are http requests and
they only show host info for a get statement.
Can anyone tell me what is going on here? Do you think that maybe my ISP is
hiding the host info for incoming TCP packets on my PPPoE connection to ruin
this sort of a setup? Any help, analysis, or tips would be most welcome.
-- My email address is invalid, thanks to all of these rotten spambots. Email me by assembling this address: tinykitty "ay tea" ohmster "dee oh tea" com ~Ohmster