• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with localhost

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I installed apache tomcat, when I type http://localhost, web browser automatically inserts www and .com into url, and makes it become http://www.localhost.com
I can't understand. Please, help me solve this problem!
(I use Win vista)
Thanks so much!!!
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat is hosted at port 8080 by default.

If you don't specift a port, your browser assumes 80 which is the standard http port.

Hence, it can't find anything.

Use http://localhost:8080
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sebastian Janisch wrote:Tomcat is hosted at port 8080 by default.

If you don't specift a port, your browser assumes 80 which is the standard http port.

Hence, it can't find anything.

Use http://localhost:8080


I've tried as you say but nothing changes. Web browser still automatically inserts www and .com. Now the URL becomes http://www.localhost.com

I try doing the same installation on another computer ( Win XP ). Everything works well!
I don't know whether it is the OS's fault or not!
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you type http://localhost:8080 or only localhost:8080 ... Firefox I think prepends the www. if you omit http://
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I typed http://localhost:8080. Is there any thing wrong with my web browser?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try 127.0.0.1 and also try another browser...
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
In internet explorer, from Tools,Internet Options and then from Programs tab, try to reset the Web Settings.

Thank you
/Abhi

 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sebastian Janisch wrote:try 127.0.0.1 and also try another browser...


thank you very much! 127.0.0.1 is okie! But I still don't know why localhost doesn't work
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you ping localhost?
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Sturrock wrote:Can you ping localhost?


No, I can't
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Open this file : c:\Windows\System32\drivers\etc\hosts (With Notepad)
these lines will be works:

Ps. restart browser after saved the hosts file.
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi -

Shinson Moon is correct.

The problem is an issue with IPv6 (which now comes standard in Windows Vista and above). The workaround is to comment out "::1 localhost" from your local /etc/hosts (c:\windows\system32\drivers\etc\hosts) file.

An *additional* problem is that Vista might not let you *edit* the hosts files. The workaround here is to <right-click> the "cmd" icon, and "run as administrator".

Vista can be a real a PITA...
 
reply
    Bookmark Topic Watch Topic
  • New Topic