Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Virtual Domain and host info in http request

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Help sought for Apache/PHP setup problem  
Author Message
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 1) Posted: Mon May 31, 2004 9:07 pm
Post subject: Virtual Domain and host info in http request
Archived from groups: alt>apache>configuration, others (more info?)

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

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.

Thank you.

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

 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
usenet24

External


Since: May 31, 2004
Posts: 2



(Msg. 2) Posted: Mon May 31, 2004 9:07 pm
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ohmster wrote:
 > 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.

Did you see the http.conf I posted which does _exactly_ what you want to
do? I took it from my archive CD from when I ran a web hosting company.



 > 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:
 > <a style='text-decoration: underline;' href="http://www.mydomain.com" target="_blank">www.mydomain.com</a>\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.


Make it simple; create an index.html page that displays "hello world,
this is virtual domain <domain name here". That's it. No images, nothing.

Why? Because if it works on the initial GET request of / or index.html,
then you'll know it's working.


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


Forget about all of this stuff.


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


You are correct. With name-based hosting, if the client doesn't spit up
"Host: <a style='text-decoration: underline;' href="http://www.somedomain.com" target="_blank">www.somedomain.com</a>", then they're going to get the root site (if
it's configured at all). This was one of the obstacles for web hosting
companies because they had customers complaining that so-and-so couldn't
see their site and that's because they were still running some
antiquated browser.



 > 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.
 >
 > Thank you.
 >

It is possible, though very unlikely, that your ISP has a bad
transparent proxy or some cache or some dns problem. But I doubt that
is the problem.

My way of approaching this problem would be:

1. Create the simple index.html page on the server in question that is
something like <html>
<head>
<title>Title for <a style='text-decoration: underline;' href="http://www.virtualdomain.com" target="_blank">www.virtualdomain.com</a>
</title>
</head>
<body>
<a style='text-decoration: underline;' href="http://www.virtualdomain.com" target="_blank">www.virtualdomain.com</a>
</body>
</html>

2. Forget trying to birddog this through your isp. Log into the
server, telnet to the IP:80 and start pretending you're a browser (cut
and paste from notepad or pico or whatever you're using is helpful) and
see what responses you get.

If the responses are not right, then it's pretty clear it's an Apache
config problem. If they are right, then you know to look somewhere else.

I suspect there's something amiss in your Apache config.


--

WWJD? JWRTFM
Rot13 for email address: yvfgf @ ehqa.pbz<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 3) Posted: Mon May 31, 2004 10:21 pm
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jeff Breitner <usenet.TakeThisOut@rudn.com> wrote in
news:10bmvc7c9tntd85@corp.supernews.com:


 > Did you see the http.conf I posted which does _exactly_ what you want to
 > do? I took it from my archive CD from when I ran a web hosting company.

Yes, but it is line wrapping pretty badly here and I am afraid to try it. Can
you please zip this file and send it to my email or give me a link to this
file so that I can "download it fresh", Jeff?


 > Make it simple; create an index.html page that displays "hello world,
 > this is virtual domain <domain name here". That's it. No images,
 > nothing.
 >
 > Why? Because if it works on the initial GET request of / or index.html,
 > then you'll know it's working.

I did this. I created a simple, plain html page with text on it showing the
destination that I have reached. I did not enable this for the capture,
though. Perhaps this is a good idea, then http GET would not be able to fetch
any gif images or anything else but request the index.html document. Good
idea.



 > Forget about all of this stuff.


Sounds good to me. Smile


 >
 > You are correct. With name-based hosting, if the client doesn't spit up
 > "Host: <a style='text-decoration: underline;' href="http://www.somedomain.com" target="_blank">www.somedomain.com</a>", then they're going to get the root site (if
 > it's configured at all). This was one of the obstacles for web hosting
 > companies because they had customers complaining that so-and-so couldn't
 > see their site and that's because they were still running some
 > antiquated browser.

Roger.


 >
 > It is possible, though very unlikely, that your ISP has a bad
 > transparent proxy or some cache or some dns problem. But I doubt that
 > is the problem.

Hmmmm...


 > My way of approaching this problem would be:
 >
 > 1. Create the simple index.html page on the server in question that is
 > something like <html>
 > <head>
<font color=purple> > <title>Title for <a style='text-decoration: underline;' href="http://www.virtualdomain.com</font" target="_blank">www.virtualdomain.com</font</a>>
 > </title>
 > </head>
 > <body>
<font color=purple> > <a style='text-decoration: underline;' href="http://www.virtualdomain.com</font" target="_blank">www.virtualdomain.com</font</a>>
 > </body>
 > </html>
 >
 > 2. Forget trying to birddog this through your isp. Log into the
 > server, telnet to the IP:80 and start pretending you're a browser (cut
 > and paste from notepad or pico or whatever you're using is helpful) and
 > see what responses you get.

I do not have telnet enabled on my redhat machine, I use ssh. Can I do it
this way or do I have to enable telent for this?

 >
 > If the responses are not right, then it's pretty clear it's an Apache
 > config problem. If they are right, then you know to look somewhere
 > else.
 >
 > I suspect there's something amiss in your Apache config.
 >

I don't think so... I used a "fresh rpmnew" one for the test but at this
point, anything is possible. I like this simple index with destination test
idea, turning on the virtual hosts, running ethereal to caputure, telnetting
in and seeing what happens.

Uhm, how exactly does one "pretend to be a browser" with telnet? I can telnet
to port 80 for sure but what would I to to present myself as a browser to see
what is going on? And will ssh not work for this (probably not)?

Waiting on your reply, this is killing my holiday.

Thank you Jeff.



--
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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
usenet24

External


Since: May 31, 2004
Posts: 2



(Msg. 4) Posted: Mon May 31, 2004 10:21 pm
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ohmster wrote:

 >
 > Yes, but it is line wrapping pretty badly here and I am afraid to try it. Can
 > you please zip this file and send it to my email or give me a link to this
 > file so that I can "download it fresh", Jeff?

I'll see if I can email it to you.


 > I do not have telnet enabled on my redhat machine, I use ssh. Can I do it
 > this way or do I have to enable telent for this?

You just need to have the telnet client, not the server. You're going
to telnet to port 80 and the server isn't going to be the telnet server,
but Apache.



 > I don't think so... I used a "fresh rpmnew" one for the test but at this
 > point, anything is possible. I like this simple index with destination test
 > idea, turning on the virtual hosts, running ethereal to caputure, telnetting
 > in and seeing what happens.
 >
 > Uhm, how exactly does one "pretend to be a browser" with telnet? I can telnet
 > to port 80 for sure but what would I to to present myself as a browser to see
 > what is going on? And will ssh not work for this (probably not)?
 >


Well, you're going to spit at it what a browser would spit at it.

As a minimum, you'll want to say something like:

  >telnet <a style='text-decoration: underline;' href="http://www.something.com" target="_blank">www.something.com</a> 80
Trying 66.35.250.151...
Connected to <a style='text-decoration: underline;' href="http://www.something.com." target="_blank">www.something.com.</a>
Escape character is '^]'.
(then you type)
GET / HTTP/1.1
Host: <a style='text-decoration: underline;' href="http://www.something.com" target="_blank">www.something.com</a>

(and it should send the page)




--

WWJD? JWRTFM
Rot13 for email address: yvfgf @ ehqa.pbz<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 5) Posted: Mon May 31, 2004 11:56 pm
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jeff Breitner <usenet.RemoveThis@rudn.com> wrote in
news:10bn5ff6efo6cbd@corp.supernews.com:

 > Well, you're going to spit at it what a browser would spit at it.

I figured that part out, thanks Jeff. I am trying to work with Ken on this
and it would be easier if I could post my last reply to him so that you can
see what is going on and maybe offer some help. Okay? Thank you Jeff.

This is what I did to get into the browser with telnet. I opened a command
prompt in windows and did
telnet <a style='text-decoration: underline;' href="http://www.ohmster.com" target="_blank">www.ohmster.com</a> 80
The window stayed black. I typed this:

GET / HTTP/1.0<return>
Host: <a style='text-decoration: underline;' href="http://www.ohmster.com<return" target="_blank">www.ohmster.com<return</a>>
<hit return again to leave this line blank>

I got back the page. Never mind even trying to setup the virtuals, I cannot
even find my GET in the ethereal output! See below for details...

What do you think, Jeff?

Okay Ken,

I was able to telnet in as you said without enabling telnet, this is good. I
ran the ethereal program and managed to figure out how
to only display http protocol. One can go much further with this and break it
down with more filtering, it would be neat if I could
filter down to the host part but this is too hard for me to figure out.

I wish that the network was more "quiet" for this test but even filtering
only to http, I get a ton of stuff to weed through in the
very short time that the test is run. I cannot find my telnet test in the
packets that I captured. My windows machine has an IP
address of 192.168.0.3 (On the LAN, served up by the linux machine.) and
nowhere in the source or destination fields of ethereal do
I see 192.168.0.3. It is like I got by the capture somehow.

I don't get it, I connected to port 80 with telnet, saw the page in the
telnet window so the server definitely answered, but I
cannot find my GET request anywhere in the ethereal capture! There is so much
traffic to weed through but I cannot find my shot at
the browser, what am I doing wrong here?

Thanks Ken,
Paul

--
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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 6) Posted: Tue Jun 01, 2004 3:42 am
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ohmster" <donteven.TakeThisOut@thinkaboutit.com> schreef in bericht
news:Xns94FAACB6166DCmybigone@216.77.188.18...
 > Jeff Breitner <usenet.TakeThisOut@rudn.com> wrote in
 > This is what I did to get into the browser with telnet. I opened a command
 > prompt in windows and did
 > telnet <a style='text-decoration: underline;' href="http://www.ohmster.com" target="_blank">www.ohmster.com</a> 80
 > The window stayed black. I typed this:
 > GET / HTTP/1.0<return>
<font color=purple> > Host: <a style='text-decoration: underline;' href="http://www.ohmster.com<return></font" target="_blank">www.ohmster.com<return></font</a>>
 > <hit return again to leave this line blank>
 >
 > I got back the page. Never mind even trying to setup the virtuals,
You need to request version 1._1_ in order to get the Host: header
recognized.
This header is the _key_ to your virtualhosts.

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 7) Posted: Tue Jun 01, 2004 4:19 am
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"HansH" <hans.DeleteThis@niet.op.het.net> wrote in news:c9gcd4$ua8$1@news.cistron.nl:

 > You need to request version 1._1_ in order to get the Host: header
 > recognized.
 > This header is the _key_ to your virtualhosts.

You know, I was thinking the same thing because this is what I read in the
apache docs somewhere. This is hard to catch though, ethereal catches too
much stuff to sort through, even for a short test. I have managed to figure
out how to display only http protocols but it can be filtered far further
than that. I wish I knew how to set the ethereal filters to only display the
http protocols that display the host info.

--
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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 8) Posted: Tue Jun 01, 2004 4:37 am
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"HansH" <hans.RemoveThis@niet.op.het.net> wrote in news:c9gcd4$ua8$1@news.cistron.nl:

 > You need to request version 1._1_ in order to get the Host: header
 > recognized.
 > This header is the _key_ to your virtualhosts.

I just tried this again with ethereal and telnetting to my linux apache
server on port 80. I set the capture and quickly did this in the telnet
window:

GET / HTTP/1.1<return>
Host: <a style='text-decoration: underline;' href="http://www.ohmster.com<return" target="_blank">www.ohmster.com<return</a>>
<hit return again to leave this line blank>

I then ended the capture and examined the packets.

I only caught MSNMS and TCP packets, and no http packets at all! The wife is
using MSN Messenger so that is the source of the MSNMS packets and the TCP
are all ACKs to my machine (The wife is web browsing.)

WTF?! How come I cannot capture these packets to examine? Let me explain the
network setup. Phone line to ADSL modem. Ethernet cable to first NIC in linux
machine. ADSL modem is setup as bridged to make it transparent. Linux connect
to PPPoE with roaring penguin script. Linux machine gets the real IP address
on interface PPP0. Linux machine has 2nd NIC to hub. 2nd NIC has NAT IP of
192.168.0.1. Hub connects to two XP machines. These machines have NAT IPs of
192.168.0.2 and 192.168.0.3.

How can I possibly not be catching these http packets? Am I monitoring the
wrong interface with ethereal? Could I be sneaking past it with my network
setup?

This is strange, I have to be able to see this in order to find out what is
wrong.

--
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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
donteven

External


Since: May 28, 2004
Posts: 24



(Msg. 9) Posted: Tue Jun 01, 2004 5:29 am
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"HansH" <hans.DeleteThis@niet.op.het.net> wrote in news:c9gcd4$ua8$1@news.cistron.nl:

 > You need to request version 1._1_ in order to get the Host: header
 > recognized.
 > This header is the _key_ to your virtualhosts.

I feel better now because I ate dinner and rested. I was getting really
frustrated with all of this but I came up with some info.

Net traffic is light now so I can do a better job of catching packets and I
am learning a little bit more about using ethereal. I
found out that my packets are indeed getting through and that they are
supplying hostname information. But, they are coming into the
machine on device eth1. This is my LAN interface and not the interface that
goes to the outside world. The host info is found in
the http layer of the first GET / HTTP/1.1 line sent to the server and this
is good. No matter how it gets into the machine, apache
is getting the host info and we can rule this out. I am now scanning with
ethereal in real time with an http filter in place. I see
that there are indeed packets coming in with http protocol, I am watching the
stationary website traffic. The first "GET
/~billscott/ HTTP/1.1" packet is the first hit on the stationary website by
an outsider. Inside of that http layer is the host info,
"Host: <a style='text-decoration: underline;' href="http://www.ohmster.com" target="_blank">www.ohmster.com</a>".

We have ruled out the domain information being missing. Finally able to
dismiss that one. Well, it must be the configs. I will try
your config and also try the one that Mike sent, although Mike only sent his
virtual host portion of his httpd.conf. I will try it but I might have
something wrong in the other portion of my httpd.conf file...

--
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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
Freebee

External


Since: Oct 20, 2005
Posts: 1



(Msg. 10) Posted: Thu Oct 20, 2005 3:55 am
Post subject: Re: Virtual Domain and host info in http request [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ohmster wrote:

Hello Jeff. I have a simular problem to setup virtual host. Is't
possible to send me the example of a working httpd.conf file, so I can
compare it with my configuration and see what it wrong.

Thanks

> Jeff Breitner <usenet.DeleteThis@rudn.com> wrote in
> news:10bmvc7c9tntd85@corp.supernews.com:
>
>
> > Did you see the http.conf I posted which does exactly what you want
> > to do? I took it from my archive CD from when I ran a web hosting
> > company.
>
 >> Stay informed about: Virtual Domain and host info in http request 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Virtual Host - Bad Request - ==> One IP, may hostnames. (name based virtual host) When I set the IP address of the virtual hosts explicitly they work fine: -------part of conf file-------- NameVirtualHost 65.94.21.150 <VirtualHost 65.94.21.150> ServerAdmin webmaster@ha...

One Virtual Host listening on several Domain names? - Hi, I would like to configure our Apache to respond to several domains (i.e. our-company.de, our-company.com, our-company.net), which are all pointing to one IP, on which the Apache is listening. The Apache is setup up with several Virtual Hosts,..

VirtualHost TransferLog collecting whole server info, not .. - In my httpd.conf I have a line for each VirtualHost that goes something like: <VirtualHost (IP address)> DocumentRoot /www/home/br ServerName br.com (not the real domain) ServerAlias www.br.com (not the real address) TransferLog..

Virtual Host - Hej Virtual host - what's that mean? I have installed Apache-Tomcat inside intranet. I want that my Apache-Tomcat listen other host inside the intranet for example : gateway! Other users from world not see my server, becouse is inside the intranet. ..

virtual host - Hi, I'm a newbie on Apache, so I need help for the configuration of Virtual Hosts. My english is bad, I'm sorry and I hope you can understand me... I've seen the documentation and I've tried many times but my configuration doesn't works... I've a lots....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]