#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    28
    Rep Power
    0

    Can't open http://localhost or http://localhost/default.htm


    I seem to have a bassackward problem, or perhaps a classical problem. Picture this. Windows 2000 Server has just been installed with IIS. A sample htm file is saved as C:\Inetpub\wwwroot\default.htm. The IP address was set to the value assigned by the router. Open a browser and go to the URL http://localhost. Not found error. Same waith http://localhost/default.htm.

    It gets better. I can open http://192.168.1.100 as assigned by a Linksys router. If I go to a computer in a different time zone and access the web site remotely, that works fine. Port 80 has been enabled ok.

    * * * How is http://localhost interpreted? Do I need to configure something to make localhost understand where to go? Should I expect http://127.0.0.1 to work? It doesn't!

    I checked the permissions of wwwroot from Windows Explorer. Web sharing is enabled for read access. I never touched anything.
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,443
    Rep Power
    4539
    Are you trying to open http://localhost from the web server or some other computer.

    Localhost is defined by an entry in your computer's hosts file and resolves to the internal tcp loopback address of 127.0.0.1

    Typically your server IP will be a fixed IP address, not a DHCP assigned address.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    28
    Rep Power
    0
    I'm trying to browse http://localhost from the server, but how would I set up the lmhosts file?

    Strangely, http://127.0.0.1 didn't work.

    I need to use a dynamic IP address so I can get on the Internet. Not really sure how to manipulate DHCP and have a static IP while I use the Internet, but I definitely would like to know since it makes more sense to set a static IP so that I don't have to set the address for IIS every time the dynamic IP changes.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,443
    Rep Power
    4539
    You are combining two separate issues.

    You should be able to open your local server website from the server itself using either http://localhost or http://127.0.0.1

    Once you get your web going, then to get to your web from the outside world, you need to have a way to resolve to your website, like with a dynamic dns service such as zoneedit.com, or a static IP. Once outside visitors can get to your IP, you need to forward port 80 traffic through any routers or firewalls so it ends up on your web server.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    28
    Rep Power
    0
    That's why my problem is so bassackwards!!

    I can see my website from computers not even in my timezone. I simply put my URL in a browser that I open on a computer accessed through pcAnywhere and I can open the web page I just created.

    However, I can't use http://localhost or http://127.0.0.1. Still, http://192.168.1.100, which is the local address assigned by the Linksys router will work. That makes me wonder - you say I can specify the meaning of localhost in lmhosts (I think this is the file as I've seen some references to it while reading forums, and I found a button for it when I looked at WINS on the network settings applet). I don't know how to set up lmhosts since I'm not really a server person. Occasionally I have to config a server while not writing bizarre applications.

    I just think you shouldn't have to define localhost anywhere right?? A few years ago I ran IIS on Win NT 4 for a bit and http://127.0.0.1 was the first thing that worked, and that was a fresh install of Win NT and IIS on my very own computer. Then I was able to go to a computer at the library and access my website before my IP address expired on my dialup! Dynamic dns has changed things since.

    Regarding static IP, I was at the networking forum where I learned that I need to set the DNS entries and gateway IP = router IP address if I want to use static IP and have Internet accessibility. This is cool for my server. Not too good for a laptop where I go different networks and have to know all the different DNS's when the ISPs change unless a generic DNS is just as good!!! I suppose that's the idea since I use my ISP's SMTP even when I'm at a different Internet access point.
    Last edited by workingForLivin; May 3rd, 2004 at 01:49 PM.
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,443
    Rep Power
    4539
    You have me confused now. What does a laptop moving around from site to site have to do with your IIS web server?

    If you are running your IIS on your laptop, you may need to retry your localhost connection if your laptop isn't connected to the Internet at the time. If you get an error about no connection when you open IE just retry it.

    If the 192.168.1.100 address is your laptop's address, it will vary as you move around. If you connect to some other DHCP network you'll get a different IP. 192.168.x.x addresses are not routable through the Internet, this IP range is reserved for private LAN's.

    Your hosts (not LMHosts) file defines the IP for localhost. Every version of Windows from Windows 95 on that I've seen comes with a preset hosts file containing a localhost entry.

    Your settings for gateway IP is the entry that defines where non-LAN outbound traffic goes if it's not on your LAN subnet, typically it's the IP of your router. This has nothing to do with running your web server, the gateway and dns settings in your network configuration are for your computer when visiting other websites.

    If you open a command prompt window and enter ping localhost, you should get replies from 127.0.0.1, which is your own computer. If this doesn't happen the only place I know to look is your hosts file. On this XP Pro computer even if I remove the hosts file entry localhost still returns 127.0.0.1.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    28
    Rep Power
    0
    the side issue of my laptop moving around and perhaps not being able to access the Internet once I set it to a static IP is not really a problem (unless there is an IP address collision) - it all works fine as you can see this message and I am at a different LAN than my original post

    As far as the localhost problem is concerned - I always cannot see http://localhost no matter how many retries I do.

    The comment about the hosts file is interesting - I don't know what that is how it is configured and located but do I need it for localhost? If so, what can I do?

    As you say, the hosts file is preset that is why I expect localhost to work but maybe the hosts file has been messed up, eh? I guess I need to somehow get it back in order.

    ping localhost <-- correct syntax, I'll try this when I change my boot up from XP to Win 2000 Swerver then we shall see what is going on with IE
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    28
    Rep Power
    0
    Who can explain this:

    http://localhost:9188/

    is working but http://localhost/ does not work.

    What is port 9188 used for?

    Right now I can view my web site from an external site through port 80 - nothing new, and I can use http://<static IP within LAN> too, but localhost requires 9188, which I found accidentally by requesting IIS manager to browse to a blankety blank help file on a totally unrelated issue. Naturally port 9188 will not receive any manual enabling through the firewall although I wonder if there is some autoenable for some default purpose.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    1
    Rep Power
    0

    Smile Oops removed 127.0.0.1 from multi access


    Originally Posted by workingForLivin
    Who can explain this:

    http://localhost:9188/

    is working but http://localhost/ does not work.

    What is port 9188 used for?

    Right now I can view my web site from an external site through port 80 - nothing new, and I can use http://<static IP within LAN> too, but localhost requires 9188, which I found accidentally by requesting IIS manager to browse to a blankety blank help file on a totally unrelated issue. Naturally port 9188 will not receive any manual enabling through the firewall although I wonder if there is some autoenable for some default purpose.
    I found that I removed 127.0.0.1 from my list of Ip addresses that could access my web page. Solution was to add 127.0.0.1 back to Multiple web site access configuration in IIS. Hope that helps someone.

IMN logo majestic logo threadwatch logo seochat tools logo