Many domain sites on one IP
By Red Squirrel
GET /forums/ HTTP/1.1 Host: www.iceteks.comThere's usually more to it then that, but this is all that is required for a valid HTTP request, and you can try it for yourself in telnet. GET /forums shows that we want /forums of the host www.iceteks.com. It's the HOST: part that says that we want www.iceteks.com of the server that we sent the request to. So you can telnet www.iceteks.com 80 and send this request or telnet 220.127.116.11 80 and send this request and the server won't know the difference. It will serve www.iceteks.com's home page no matter what.
What about data physically stored?
Data is physically stored in separate folders for each virtual host, but this is seamless to the user as the server is setup to handle requests under www.iceteks.com to make that folder, the root folder. This is why you don't have to do anything silly like www.iceteks.com/iceteks/ to get to the actual data, since just saying www.iceteks.com tells the server to use /made/up/server/path/Iceteks/ as the root.
Before ending, we'll take a look at setting up a virtual host on an apache server, to test this you simply need to add the name in your host file and point to the IP of the server you do it on.
At the bottom of the http.conf file, put the following text. I don't think location matters much, but I usually put it at the bottom.
This creates a new "rental space" for a site with a domain [anything]Iceteks.loc where the root data is at /data/intranet/main/www/Iceteks and the log created for traffic on this site only would be located in /data/intranet/main/logs/Iceteks.log. The *:80 part is to tell what interface this applies to, in most servers it will stay that way.
There's more options, but this is simply to give you a brief configuration sample of a virtual host. In the future I may write a guide on how to setup a virtual host, so in that case more details would be provided on configuring ftp and email for virtual host environment, but I need to learn that myself. :) As far as I know, they work slightly different then HTTP, in the sense that they are user based so host's don't really matter. If user "iceteks" logs on to ftp, then that user is simply configured to use a certain folder. As far as email, it gets a bit more complicated, perhaps something to be covered in a future article.
I hope this article helped you get a better understanding of virtual hosting, and cleared things up on how it's made possible.
This site best viewed in a W3C standard browser at 800*600 or higher
Site design by Red Squirrel | Contact
© Copyright 2019 Ryan Auclair/IceTeks, All rights reserved