Link to home
Start Free TrialLog in
Avatar of Greg_L_WER
Greg_L_WERFlag for Canada

asked on

IIS 6 - Hosting Multiple Sites On Same Port - Using Host Header Values

I am wanting to host an ASP.NET intranet site on our local office server.  I have installed IIS and it is running and I have managed to get 1 site working as it should.  The issue came when I added a 2nd site where I couldn't start the other site as it was using the same port.  I found the solution to allow the 2nd site on the same IP by adding in "Host header values" for both sites.  This has allowed me to get both sites "Running" in IIS but I can no longer navigate to the original site.  I had created a Virtual directory "YWE" that allowed me to navigate to the site via http://111.111.1111/YWE.  Since adding in the host header values I can no longer navigate to the site as above.  During my reading I didn't come across any information as to what values would be appropriate in the host header values or how to navigate to the sites afterwards... I have tried navigating to the header value instead of the virtual directory name with no luck.  

Thanks in advance for the the help,
Greg
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

You need to set up a dns alias for each hostheader value pointing to the ip address.
Avatar of Greg_L_WER

ASKER

Thanks for the info... couple of additional questions.  As fas as DNS alias's... this is a local server that does have a domain on it but my IIS Sites are not part of that domain so how do I add in a DNS alias for them?  I read the article you mentioned and it talks about the HOSTS file.  I edited this file (on the server) to:

127.0.0.1     localhost
192.168.1.250 SQLData.com
192.168.1.250 YWE.com

I have 3 IIS web sites... these 2 and a default one that has no host header value as the article suggested.  If I try to access one of these sites when the default site is running I get:

HTTP Error 404 - File or directory not found.  Internet Information Services (IIS)

and if I stop the default site I get:  

The webpage cannot be found


Have I missed something?  Without the host name header the site will run aok.

Thanks,
Greg
It sounds like it is still directing you to the default site.

Remember with host headers you no longer specify the ip address in the url so instead of browsing to : http://192.168.1.250/ywe.com you would just browse to http://ywe.com

If you are going to do this with host files I believe that you would have to update the hosts file on the clients.

If the clients are on the domain and your domain has dns installed on a dc you can create the alias entries in the domain dns as the clients will have access to it otherwise you have to have a hosts file updated on all the clients.
That makes more sense.  The http://ywe.com does work on the actual server but not on a connected PC.  I looked into the DNS (Not overly familiar with it) and I see forward and reverse lookup sections but I was not able to create an alias entry to the web site.  My sites are not located within the "C:\Inetpub\wwwroot" folder which might have something to do with it.  I will have to do some more research on DNS aliasing to get past this last hurdle.... any articles you would suggest?
You only need to add the alias to the forward lookup zone.
Doesn't matter that the site are not located in c:\inetpub\wwroot folder


Should just be a case of going into dns, right clicking the forward lookup zone, select new alias, enter the hostheader name in the alias box, in the FQDN for target host, type IISServerName.mydomain.com.

Actually you will also need to create an A record for your IIS Server as it is not part of the domain.

http://support.microsoft.com/kb/168322

ASKER CERTIFIED SOLUTION
Avatar of Greg_L_WER
Greg_L_WER
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Unfortunately it hasn't been resolved but a new questions doesn's appear to be allowed until this one is closed off ;(