It's not a secret anymore!
The moose likes Tomcat and the fly likes Using ip address in place of localhost Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Using ip address in place of localhost" Watch "Using ip address in place of localhost" New topic

Using ip address in place of localhost

Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

The title says it all, I tried to access my webapp through ip, something like :

It says:

works just fine.
Obviously, it has something to configure in tomcat conf files, unfortunately I'm not that good at them. Just so you know, I could ping to the IP(without port no. perhaps) in question successfully, firewall has been disabled. Any help would be appreciated in this regard.

Coderanch, best ever forum on the net. Hands down.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

"Ping" isn't a tcp/ip request, it's ICMP. Same transport, different protocol. So the ability to PING an IP address simply means that the PING ICMP packet isn't firewalled, and tells nothing about tcp/ip port blocking.

The first place to look when you have connectivity problems, is to use a "netstat" command. Use "netstat -ln" for Unix/Linux and "netstat -an" for Windows. If the port is being listened to on, it's available at other addresses that just localhost and that's your cue to look at the firewall.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Using ip address in place of localhost
jQuery in Action, 3rd edition