Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with localhost  RSS feed

 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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!!!
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
try 127.0.0.1 and also try another browser...
 
Abhi Roy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you ping localhost?
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Can you ping localhost?

No, I can't
 
Shinson Moon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!