none
how IIS 7.5 resolve IP address to website, on window 7 machine, with multiple sites hosted under same IP address and port number RRS feed

  • Question

  • I have a windows 7 machine, with iis 7.5 installed, I have two websites created binded to same address (127.0.0.1), same port, different hostName, one is same www.abc.com, another one is www.edf.com, when I type "http://127.0.0.1/doc.html", I got 404 error on my machine, however, my fellow coworker does not get that error with same url, I am curious why and how IIS really behind the scene figuring out the right site to send request?
    Tuesday, September 23, 2014 2:55 PM

Answers

  • IIS only understands hostname/port. If you have multiple sites on the same binding (port 80) and want to browse to your server using it's public IP it'll only show the default site.

    You need to provide the hostname for this to work OR make abc.com your default binding (it become default when you create a binding for the site without hostname on port 80).

    If you won't this means you need to browse to:

    http://www.abc.com/doc.html


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"


    Tuesday, September 23, 2014 5:55 PM
  • Hi devhorse,

    This forum is used to discuss the question about the Windows Communication Foundation, Serialization, and Networking, then for your question it will be better for you to post it in the IIS forums, then you will get good replies from the IIS experts.

    #IIS Forums:
    http://forums.iis.net/.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, September 27, 2014 7:40 AM
    Moderator

All replies

  • IIS is figuring out nothing. You told where the file was at by giving a url with the IP in the url. 127.0.0.1 means localhost or local to the machinel, or the loopback IP looping all traffic back to the Web server running on the local machine. Either that file is in a virtual directory for the site on the local machine or it's not there. 

    http://en.wikipedia.org/wiki/Localhost

    http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400c.htm

    I don't know what url your coworker is giving, but whatever is being given, which must have some IP in the URL, it's being found.

    Tuesday, September 23, 2014 5:20 PM
  • sorry, I did not make my problem fully understood, here is my situation:

    www.abc.com is created with physical path as c:\sites\abc

    another site www.edf.com is created with physical path as c:\sites\edf,

    in my host file:

    127.0.0.1  www.abc.com

    127.0.0.1  www.edf.com

    doc.html lives at c:\sites\abc\doc.html on my local disk,

    but, when I browser the site on the same machine using following url

    http://127.0.0.1/doc.html, I got 404 error.


    • Edited by devhorse Tuesday, September 23, 2014 5:48 PM
    Tuesday, September 23, 2014 5:46 PM
  • IIS only understands hostname/port. If you have multiple sites on the same binding (port 80) and want to browse to your server using it's public IP it'll only show the default site.

    You need to provide the hostname for this to work OR make abc.com your default binding (it become default when you create a binding for the site without hostname on port 80).

    If you won't this means you need to browse to:

    http://www.abc.com/doc.html


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"


    Tuesday, September 23, 2014 5:55 PM
  • I  know http://www.abc.com/doc.html will work, but some times, http://127.0.0.1/doc.hml works, sometimes does not work, it looks like the default site made the difference. I will give it a try.

    Tuesday, September 23, 2014 6:00 PM
  • what is default site, is it deployed under inetpub\wwwroot considered default website?
    Tuesday, September 23, 2014 6:11 PM
  • Usually it's the one called default site.

    It's the site that it's binded usually to all ip addresses without hostname on port 80.



    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    Tuesday, September 23, 2014 6:16 PM
  • Hi devhorse,

    This forum is used to discuss the question about the Windows Communication Foundation, Serialization, and Networking, then for your question it will be better for you to post it in the IIS forums, then you will get good replies from the IIS experts.

    #IIS Forums:
    http://forums.iis.net/.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, September 27, 2014 7:40 AM
    Moderator