• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Is localhost always = 127.0.0.1 ?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
Is localhost always = 127.0.0.1 for Tomcat 4.0?
I did check it on 5 machines.
http://localhost:8080 always brings me "An error has occurred processing the request...
Unable to contact site SERVER
Press 'Refresh' on your browser to try again."
http://127.0.0.1:8080 is OK.
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Open up the Hosts file in C:\Windows in an editor. Add the following line at the bottom of the file:
127.0.0.1 localhost
That should do the trick. You can now use http://localhost:8080
/rick
 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I enter this in the host file?
111.111.111.111 localhost
Then enter 111.111.111.111:8080 in browser?
Just a thought.
Thanks.
Bruce
 
Oleksandr Karpus
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi rich salsa
I've always had a line "127.0.0.1 localhost" in my C:\winnt\system\drivers32\etc\hosts.
So It doesn't work.
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You Don't want to remap localhost. This is a "magic" IP address and I don't know what would break but certainly wouldn't care to find out.
On my Linux system, the OS install created a line in the /etc/hosts file tagged with the comment that removing the localhost definition would "cause various programs that require network funcitonality to fail". The Windows equivalent to /etc/hosts is %WINDOWS%\LMHOSTS, but that file is not present by default, so I suspect that the definition for localhost is either hard-coded in the OS or hidden in some sneaky part of the Registry.
There are some OS's where localhost ISN'T defined by default - I believe I've read of Solaris being noted for that. However, it is ALWAYS defined for any Windows 9x/NT (or successor) networked machine.
If you really want to write something tied to your specific machine (as opposed to whatever machine you're running the software on) refer to it by its hostname - which is the machine ID it was given by the LAN administrator (visible in Network Neighborhood/Properties, aka "My Network Places/Properties").
If you enter "http://localhost" or "http://127.0.0.1" in your browser, it will look for a web server running at TCP/IP port 80 on your computer. If you want to access that server from another computer in your LAN and the machine ID is "FRED123", then say "http://FRED123".
Under Linux, IP 127.0.0.1 isn't attached to a physical network device - it uses a special device called the "loopback" device. Windows may be doing something similar for performance reasons.
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic