[Nottingham] Re: Web server questions

Matt nottlug at spandex.nildram.co.uk
Sat Apr 9 22:17:06 BST 2005


Saturday, April 9, 2005, 8:12:50 PM, you wrote:

DA> ... So it looks as though it works with two on the same IP!

This is called virtual hosting and AFAIK was introduced with HTTP1.1.
Without this every website would need it's own IP and we'd soon run
out. One of the headers the browser sends is the "Host" header which
the server uses to decide which virtual host to use, and each virtual
host can have it's own DocumentRoot and other settings.

You can check this out by telnetting to port 80.. e.g for the two
virtual hosts at www.cclgb.org.uk and www.mumpers.org.uk both on the
IP 209.51.140.90 you can do this...

spandex at pr0k:~$ telnet 209.51.140.90 80
Trying 209.51.140.90...
Connected to 209.51.140.90.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.cclgb.org.uk
<blank line here indicates end of GET request>
<the server sends back the HTML for www.cclgb.org.uk here>

And if you type the domain name of another virtual host on that
machine (e.g. www.mumpers.org.uk) then you get that site instead.

Hope this isn't too OT.

Regards,

Matt




More information about the Nottingham mailing list