Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Host headers and single IP 2

Status
Not open for further replies.

lipo

Programmer
Nov 25, 2002
52
US
I want to utilize host headers for multiple sites and a single IP address. I have configured the multiple sites using multiple identities for this site and I changed the DNS thru zonedit. However, when I go to the url in the browser, all I get is the default page in default web site. The only way I can view the site in the browser is by typing website1.com/website1 for each site. It seems that I have to list the directory in which I placed the site in order to reach it in the browser.
 
Make sure each site has its own folder. When setting up a site in IIS, when it wants to know what folder the website is at... choose the correct folder (the root of that website). Also, make sure your index page is in the webroot.

We have about 200 websites setup like this on one IP and it works perfectly. Roger Villeneuve
 
You do not set up multiple identities for a site, That will make all DNS CNAMES point to the default site, Each site must have its own identity.
What you have to do is create a new website in the IIS MMC for each site you host with the Home Directory for each one set as SWD suggests, then configure the host header for each site.
Something that I do for each site is to have the main folder for the site then a as the root and a logs folder in the main folder (for the log files).

Like so:
MainIISFolder
|
|
SiteFolder ' repeated for every site
|---logs ' logs folder
|---www ' root folder
|
|----SiteFolders 'user created stuff

I also have all sites configured on a different drive in a separate folder so they are away from the default path of c:\inetpub etc (Anti-Virus\Hacking). this way the anon user has no access at all to any system drives or anything beyond this folder. Disable the default site and the Admin site then have a site with just a default page and no FP extensions with no host header and every kind of access to this folder secured up, leave anon access on of course. This will become the default site and will be the target of Nimda, Code Red and any other malware that attacks port 80, this way there is less risk of infiltration.

And always make sure you are fully up to date with SPs and Patches, be careful with the IIS Lockdown tool it can shut off all access if used incorrectly.

Chris.
Indifference will be the downfall of mankind, but who cares?
 
I have set up each site with its own folder. Should I delete "Default web site" ? If I place the index page in the webroot, how does it distinguish between the different sites that have the same index page name (index.htm) ??
Do I need to set up virtual directories from the default site for each individual site?
 
you have to set up each site as an individual site (not virtual directory) in the IIS MMC. Right Click on the server name then choose New > Site

To use my example:

MainIISFolder
|
|
SiteFolder1 ' repeated for every site
| |---logs ' logs folder
| |---www ' root folder
| |----index.htm
| |----SiteFolders 'user created stuff for website1
|
|
|
SiteFolder2 ' repeated for every site
|---logs ' logs folder
|---www ' root folder
|----index.htm
|----SiteFolders 'user created stuff for website2

so in the MMC you would have Website1, host header website1.domain.com with home directory drive:\mainIISFolder\sitefolder1\ in ..\ Website2, host header website2.domain.com with home directory drive:\mainIISFolder\sitefolder2\ in ..\www

And so on
you don't have to delete the Default site just stop it

Chris.

Indifference will be the downfall of mankind, but who cares?
 
Ahhhh! just a thought you are setting this up on Win 2k server

I hope!!!!!!!!!!!!!!


Chris.

Indifference will be the downfall of mankind, but who cares?
 
I was setting this up on Win2K prof and I cannot click on server to get "new". This choice is not available on server name. I have to click on "Default domain" to get "new". Is is possible to set up host headers on Win2 K prof?
 
Nope. One (default) website only on 2k Pro and you will also run into problems with the 10 connections (users)limit in 2k Pro trying to run it as a webserver.


Chris.
Indifference will be the downfall of mankind, but who cares?
 
I have Windows.net 2003 standard server beta. I tried with this os and found that I can only get "new" from the default web site and not from the server name. However, I was able to get "new web site" and not virtual. I will try with this OS but I have to wait till tomorrow to go to the office to connect it to the fixed IP.

Thank you everyone
 
How exactly do you configure the IP addresses on the DNS server so the domain name would be accessible to the internet using Host headers? Do you point all domains to the one IP address you have set on your servers NIC and then let the Host headers to the work? I have found several bits of information on setting Host headers but no one ever explains how to exactly set the DNS server. They just state, “set the DNS” HOW!
 
Assume the external IP of your router is 1.2.3.4, in DNS you would set up your domains as

domain1.com A 1.2.3.4

domain2.com A 1.2.3.4

domain3.com A 1.2.3.4
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top