Add new website IIS 7 (Vista)

Hello all,

For all of us programmers or web developers working with websites, you know the need to open more then one website (by default) on your development machine.

Sometime you need all a website to stand on its own and not be a sub directory or a virtual directory (like: http://localhost/your_webiste).

Why, well let’s say your using URL rewriting, then you need to use parent path’s like so:

   1: <img src="/Assets/Images/Avi.png" alt="" />

If you try to do this while using a VD you will get errors and your images won’t be displayed, you have to use a standalone website for this.

So, let me tell you how to do it with IIS 7 (I’m working with vista, it’s the same for IIS 7 on any other machine).

For all of you guys with XP out there, you cannot do this, so please other upgrade to vista or windows 7 (:-))

I have my own method of how to do this, that make me remember the web address easily.

It goes like this: if I’m working on my website (http://www.kensodev.com) the local version of it will be (http://local.kensodev.com –> link not working).

ok ok I’m getting there :-)

How to add a new website IIS 7 on Vista?

First, open IIS manager on vista (Start—>Administrative Tools—>IIS Manager)

2009-04-30_1927

On the left you will see the “sites” folder, right click on it and select “add website”, you will get this dialog.

2009-04-30_1933

Fill the text boxes just as I did, give it your own names of course and select the local folder where the files are located.

This is just about it for IIS, don’t try to navigate to the website yet, you will get an error.

Next step: Please open up notepad (with admin privileges), hit file—>Open (select *.*) and navigate to the folder  C:\Windows\System32\drivers\etc

You will see these files:

2009-04-30_1936

Click the “hosts” file and open it, If you didn’t define any website you will only see “localhost”

Now, we will add a record at the end of this file.

Type 127.0.0.1 and hit the TAB button on your keyboard, then type the name that you gave your website. In this case “local.kensodev.com” no need to type http:// or www.

2009-04-30_1938

That’s it.

Now, lets open up a browser an navigate to the website.

2009-04-30_1942

Just to check that the browser isn’t routed to a remote website lets ping to it using the command line.

2009-04-30_1943

And that’s the end, you have another website on your IIS, and you can browse to it.

  • http://www.google.com KattyBlackyard

    The best information i have found exactly here. Keep going Thank you

  • http://www.google.com KattyBlackyard

    The best information i have found exactly here. Keep going Thank you

  • http://www.google.com GarykPatton

    How soon will you update your blog? I’m interested in reading some more information on this issue.

  • http://www.google.com GarykPatton

    How soon will you update your blog? I’m interested in reading some more information on this issue.

  • http://www.google.com KonstantinMiller

    I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

  • http://www.google.com KonstantinMiller

    I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

  • Belkija

    why in my iis server its not loading the default.aspx it is loading the locallhost default page

  • Belkija

    why in my iis server its not loading the default.aspx it is loading the locallhost default page

  • Priyanshu

    Hi Kensodev,

    Nice post, but its not working when i am trying to open teh website from the internet.
    Tried a lot of things but all waste. I am trying to host my own website with the help of no-ip.com updater but somethings is not set correctly and the website doesnt open up on other systems.
    Any ideas ??
    By the way i am using Windows 7 Ultimate.

    • http://www.kensodev.com Avi Tzurel

      Could be connected to a firewall issue.
      When trying to open a connection to your computer from outside you should configure your firewall.

  • Priyanshu

    Hi Kensodev,

    Nice post, but its not working when i am trying to open teh website from the internet.
    Tried a lot of things but all waste. I am trying to host my own website with the help of no-ip.com updater but somethings is not set correctly and the website doesnt open up on other systems.
    Any ideas ??
    By the way i am using Windows 7 Ultimate.

    • http://www.kensodev.com Avi Tzurel

      Could be connected to a firewall issue.
      When trying to open a connection to your computer from outside you should configure your firewall.

  • http://www.kensodev.com Avi Tzurel

    @:

    why in my iis server its not loading the default.aspx it is loading the locallhost default page

    What is the error you are seeing?

    • alwayswhy

      Sorry, I reply your coment here. I can see my website from my computer, and it’s 100% work. But, when I tested it (open) from my iPhone, message appears “Safari cannot open the page because the server cannot be found”. Why why and why?????
      Have I done wrong?

  • http://www.kensodev.com Avi Tzurel

    @:

    why in my iis server its not loading the default.aspx it is loading the locallhost default page

    What is the error you are seeing?

  • Priyanshu

    Hey Avi,

    Thanks for teh reply.
    I check everything regarding the port 80 on firewall and my isp hasnt blocked it. I have configured an exception.
    Could it be something with the NAT enabled on my modem.
    Whne i checked my port 80 status on http://www.dyndns.com/support/tools/openport.html , i get teh message that “An attempted connection to 122.177.6.144:80 was refused. This typically indicates that there are no services available on that port, but that it is NOT being blocked by a firewall or your ISP.
    Hope it has nothing to do with the NAT enabled on my modem coz i have no idea what that means :) .

    The error message i am getting on the other computer while browsing the website is PCBD.

    Thanks Avi

  • Priyanshu

    Hey Avi,

    Thanks for teh reply.
    I check everything regarding the port 80 on firewall and my isp hasnt blocked it. I have configured an exception.
    Could it be something with the NAT enabled on my modem.
    Whne i checked my port 80 status on http://www.dyndns.com/support/tools/openport.html , i get teh message that “An attempted connection to 122.177.6.144:80 was refused. This typically indicates that there are no services available on that port, but that it is NOT being blocked by a firewall or your ISP.
    Hope it has nothing to do with the NAT enabled on my modem coz i have no idea what that means :) .

    The error message i am getting on the other computer while browsing the website is PCBD.

    Thanks Avi

  • http://www.kensodev.com Avi Tzurel

    @Priyanshu : Seems like the IIS is not listening to outside connections.

    When I paste the IP you supplied in the comment into the browser I don’t get any response. Like I said, usually this is due to a firewall exception or sometimes even a router blocking the connection.

  • http://www.kensodev.com Avi Tzurel

    @Priyanshu : Seems like the IIS is not listening to outside connections.

    When I paste the IP you supplied in the comment into the browser I don’t get any response. Like I said, usually this is due to a firewall exception or sometimes even a router blocking the connection.

  • Priyanshu

    Hi Avi,

    Thanks again for the reply.
    Sorry for the troubles here.
    I actually dont have a router and i have made an exception of port 80 in my firewall, both for inbound and outbound connections.Can you suggest any tutorials for hosting our website from home using dyndns or no-ip.com. By the way my system has a dynamic ip and i have dyndns updater installed on the system to make that changes in their website.
    As far as i know i have done everything right.

    P.S. I have managed to turn off the NAT on my modem as well. Still the same problem.

    Thanks again.

  • Priyanshu

    Hi Avi,

    Thanks again for the reply.
    Sorry for the troubles here.
    I actually dont have a router and i have made an exception of port 80 in my firewall, both for inbound and outbound connections.Can you suggest any tutorials for hosting our website from home using dyndns or no-ip.com. By the way my system has a dynamic ip and i have dyndns updater installed on the system to make that changes in their website.
    As far as i know i have done everything right.

    P.S. I have managed to turn off the NAT on my modem as well. Still the same problem.

    Thanks again.

  • Priyanshu

    Hi Avi,

    If you can suggest me aby commands to check the port 80 status on the system , or perhaps any website for tha same.
    I checked with netstat command and it comes with port 80 is listening.

    Thanks again.

  • Priyanshu

    Hi Avi,

    If you can suggest me aby commands to check the port 80 status on the system , or perhaps any website for tha same.
    I checked with netstat command and it comes with port 80 is listening.

    Thanks again.

  • http://www.kensodev.com Avi Tzurel

    @Priyanshu:
    I think windows 7 and Vista you need to check the inbound rule for “World Wide Web Services (HTTP Traffic-In)” and this will enable your IIS to listen for inbound connections.

    I just checked it on my system and it works great, I managed to connect from an outside server to my home machine.

  • http://www.kensodev.com Avi Tzurel

    @Priyanshu:
    I think windows 7 and Vista you need to check the inbound rule for “World Wide Web Services (HTTP Traffic-In)” and this will enable your IIS to listen for inbound connections.

    I just checked it on my system and it works great, I managed to connect from an outside server to my home machine.

  • Priyanshu

    Hey Avi,

    Thanks for your efforts man.
    Tried that too, doesnt work.

    May be i did something wrong, here is the thing.
    On the host system (from which i am hosting the website) when i open the url http://windows.blogdns.com/ it opens up.
    But it doesnt open up with http://www.windows.blogdns.com it wont open up. I followed the exact steps above in this forum (expect for the part that i registered with dyndns to get a free domain name and ip updater i have a dynamic IP adress) .I guess there is something i dint do right or maybe the dyndns is not what it claims to be (which i rather doubt).

    Please let me know if there is another way of hosting website from home when the system has a dynamic IP address.
    Any suggestions would be appreciated.

    I will keep you posted if i find something on this. :)

  • Priyanshu

    Hey Avi,

    Thanks for your efforts man.
    Tried that too, doesnt work.

    May be i did something wrong, here is the thing.
    On the host system (from which i am hosting the website) when i open the url http://windows.blogdns.com/ it opens up.
    But it doesnt open up with http://www.windows.blogdns.com it wont open up. I followed the exact steps above in this forum (expect for the part that i registered with dyndns to get a free domain name and ip updater i have a dynamic IP adress) .I guess there is something i dint do right or maybe the dyndns is not what it claims to be (which i rather doubt).

    Please let me know if there is another way of hosting website from home when the system has a dynamic IP address.
    Any suggestions would be appreciated.

    I will keep you posted if i find something on this. :)

  • Priyanshu

    Hi Avi,

    Just a quick question.
    If thats a problem with the port 80 is it possible to redirect teh website on some other port?

    Thanks

  • Priyanshu

    Hi Avi,

    Just a quick question.
    If thats a problem with the port 80 is it possible to redirect teh website on some other port?

    Thanks

  • http://www.omnisupport.com Glen “Loves the Technical Supp

    Thanks so much – I previously was using multiple ports on localhost before finding this page! Such a simple thing, but took me ages to find find the answer was with the hosts file…!

  • http://www.omnisupport.com Glen “Loves the Technical Support” Parker

    Thanks so much – I previously was using multiple ports on localhost before finding this page! Such a simple thing, but took me ages to find find the answer was with the hosts file…!

  • http://www.kensodev.com Avi Tzurel

    @Glen:
    Took me ages as well, that’s why I posted this :-)
    Glad I could help out.

    Avi

  • http://www.kensodev.com Avi Tzurel

    @Glen:
    Took me ages as well, that’s why I posted this :-)
    Glad I could help out.

    Avi

  • Eugene

    Good post! Brief and to the point. Exactly what I was looking for. Toda raba ;)

  • Eugene

    Good post! Brief and to the point. Exactly what I was looking for. Toda raba ;)

  • hassan

    hello my dear friend
    i have a problem in my website,when i want to browse my application there is some error,it has some errors in module handller,could u please help me?i can take picture from this erro and send for u,
    thanks for your honestly attention.
    your little friend ;)

  • hassan

    hello my dear friend
    i have a problem in my website,when i want to browse my application there is some error,it has some errors in module handller,could u please help me?i can take picture from this erro and send for u,
    thanks for your honestly attention.
    your little friend ;)

  • http://www.kensodev.com Avi Tzurel

    @hassan
    I would love to help
    email me to avi AT kensodev DOT com

  • http://www.kensodev.com Avi Tzurel

    @hassan
    I would love to help
    email me to avi AT kensodev DOT com

  • nomadsToday

    You are the maaaaaaaaaaaaaaaaaaaaaan!!!

    Works beautifully and such a simple solution as well.

    Thanx!!!

    • http://www.kensodev.com Avi Tzurel

      You are welcome, I am glad I could help

  • richie

    i can access my published website on my server, but i can’t access it to the other computer (but i can access the localhost/server ip).. i already turn off the firewall, allowed the port 80, but still got the same result :(

    can somebody help me??? i badly need it..

    • http://www.kensodev.com Avi Tzurel

      @Richie Are you using a router?

      • alwayswhy

        This is the same problem. Is this all can not be done if I use a router? Then what should I do to my website can be accessed from anywhere?
        Your answers appreciated.

        • http://www.kensodev.com Avi Tzurel

          You can use a router (I do) but you have to understand one thing.

          let’s say your home external IP is XXX.XXX.XXX, this is the IP for all of the computers, you have to route the external traffic to a specific inner address.

          This can only be done through the router and it’s brand dependent so I can’t help you more then that because I will have to know your router brand.

  • richie

    @sir AVI

    yes i’m using a router..

    • http://www.kensodev.com Avi Tzurel

      @Richie if you are using a router you have an inner firewall (just so you know).

      What you need to do in order to solve it is to configure your router to accept inbound connection and point it to the correct inner address.

      for example
      when a connection comes from outside to this IP, route the traffic to 192.168.2.101

      This is a simple configuration but it’s router dependent so I cannot help you any more then that.

      Feel free to ask any further question and I’ll see if I can assist any more.

      Thanks

  • richie

    i also cannot ping mysite.com, but i can ping the server ip.. the client computer might directing me to the outside network (mysite.com) that’s why i got an error?

  • http://pulse.yahoo.com/_YVXG26JKPB7NXRVJ7EOAQH4EAQ Kuldeep Tyagi

    gr8 article… now what if i want to share this local website on my Local network ? Please help me … thanks in advance :)

    • http://www.kensodev.com Avi Tzurel

      All you need to do is type in your computer IP/Name and you can access it through another computer.
      if you can’t please configure your firewall and allow http sharing.

      • http://pulse.yahoo.com/_YVXG26JKPB7NXRVJ7EOAQH4EAQ Kuldeep Tyagi

        Thank you for replying. As i type my computer name / ip it takes me to the default web site directory browsing

        • http://www.kensodev.com Avi Tzurel

          In this case, what you need to do is define the website in the hosts of the computer you are accesing from, then just typing in the address of the website and that’s it.

          When you define a new website on the IIS machine you can give it a host name, when a request comes with this host name this website is triggered and shown to the user.

          This is exactly how share hosting works, all of the websites are on the same IP yet you can access each with it’s host name

  • Scott White

    I’m having an issue similar to Kuldeep, though, specific to my iPad. I’ve set up this IIS server so I can build web apps for my iPad/iPhone. If I pull the IPv4 from my hosting PC and plug it into Safari on my iPad, I can access the default IIS site.

    However, I’ve created a custom site of my own, which I can see on the hosting PC, but which I can’t figure out how to access on my iPad. (I’m following instructions in a programming book, which simply say ‘enter the IP on your iPad’; my queries on the book’s forum yield the same response.)

    Problem is, i don’t know WHICH ip to enter! So, for example, let’s say:
    My PC’s IP address is: 123.456.7.89
    My Custom IIS site has a host name of: http://www.testsite.com
    If I plug ’123.456.7.89′ into Safari on my iPad, I see the default IIS site.
    What address should I use to attempt to access my custom IIS site from my iPad? I’ve tried all combos I can think of, like this:
    http://www.testsite.com
    123.456.7.89/www.testsite.com
    123.456.7.89/testsite.com
    123.456.7.89/www.testsite
    123.456.7.89/testsite
    etc.
    … but nothing works.

    Any idea what address I should be attempting to use from my iPad to access this custom site on my local network?