Monday, February 1, 2010

What is Host Header?

I am always asked about this. So i will give some explaination.

Let’s go!!!
HOST HEADER is a term in web servers, thats for sure. . If your are hosting many websites in a single machine or IP, of course you used host header. Host Header is the one who identify or map the website from the domain to the host server. For example: you have a domain NAGLAINGKA.COM registered in onlinenic or other DNS servers. This domain naglaingka.com has a dns pointer like “NS1.serverko.com and ns2.serverko.com”. You can edit the “DNS” by pointing it to your host IP.


Scenario:
1. you have domain naglaingka.com and nalalaingka.com
2. You have a webserver with public ip of 192.168.0.1

Solutions:
1. put the webpages of naglaingka.com in a folder naglaingka on the host computer.
2. put the webpages of nalalaing.com in a folder nalalaingka on the host computer.

3. login to your DNS provider and edit the DNS for nalaingka.com.

host = “blank”
type = A
data = 192.168.0.1

host = www
type = A
data = 192.168.0.1

do this also at nalalainglka.com

Note: if you notice a created 2 pointer, 1 for the blank and 1 for the www. This simply means that if you type naglaingka.com without www, still it will resolve to the IP. So you can access the website with or without the www prefix.

4. Now login to your host computer with 192.168.0.2 Internet Protocol and the ff:

4.1. Go to your Internet Information Services or simply IIS
4.2. Right click and choose New Site and click Next
4.3. Type the Description of the site
4.4. IP and Port Settings

- all unassigned
- port = 80
- hostheader = naglaingka.com
- Path = d:\naglaingka
- read only

Create again a host header for www
a. Go to the properties of the website you created
b. On the website Tab, click the advanced button
c. click Add on the multiple Identities
d. All unassigned, port = 80, hostheader = www.naglaingka.com
e. Ok. your done

Do step 4.2 until above line for the nalalaingka.com.

Finish!!

No comments:

Post a Comment