-   Linux - Newbie (
-   -   Unable to run webpage on local server using ip in the url (

MakingOfAGeek 10-05-2003 05:28 AM

Unable to run webpage on local server using ip in the url
I'm running tomcat on Linux 8.0
"htp://localhost/index.jsp" works
but "htp://<ip address>/index.jsp" doesn't

"htp://<ip address>/index.jsp" can be accessed from other machines on the same LAN

I'm also unable to access webpages run on other servers on the same LAN. I think the reason is the same. Pls help

pablob 10-05-2003 07:25 AM

Your /etc/hosts should look like this:

<ip address> hostname_of_your_linux localhost

Maybe you lack the first line, and so you cannot route your queries.

Then check your routing table; take a look at mine: (some more stuff appears, but not relevant now)

# netstat -nr

Kernel IP routing table
Destination Gateway Genmask Iface eth0 lo

This way you tell: "All the packets travelling to hosts beginning with 169.254...., use eth0 interface (network card)"
"All packets to (the host where you are sitting) use "lo" (loopback) interface", which means, don't try to go outside the machine.

MakingOfAGeek 10-06-2003 12:05 AM

my /etc/hosts: localhost tmpRH8

netstat -nr gives:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface U 0 0 0 eth0 U 0 0 0 eth0 U 0 0 0 lo UG 0 0 0 eth0

I still have the same problem

pablob 10-06-2003 10:01 AM

Why is there that eth0 route ?

MakingOfAGeek 10-06-2003 10:57 AM

I dont know... I dont know how a got there either

Accessing "http://<ip address>/index.jsp" results in a
"server error. Please contact system administrator"

pablob 10-06-2003 11:05 AM

OK. So it really seems like you're have a routing problem, misconfigured network or whatever.

According to your IP address and netmask, it is ok for to be there, but I really don't understand 192.168.... Do you have two ethernet cards plugged in ???

MakingOfAGeek 10-07-2003 03:13 AM

No theres just one ethernet card

Could you tell me why netstat -nr shows a ?

pablob 10-09-2003 03:28 PM

Well, that is the only "normal" thing:

If your IP address is
and your netmask is
then your "network address" is
This is as a result of binary routing theory. You can learn some basics googleing subnet+howto

Destination Gateway Genmask Flags MSS Window irtt Iface U 0 0 0 eth0 UG 0 0 0 eth0

Here, the first line means "when looking for any element within my subnet (, use gateway (your network card)"
Second line means "for the rest of IP addresses ( use the gateway should be your modem/router internal IP address )"

MakingOfAGeek 10-12-2003 10:10 PM

yes is the router internal ip address

Any suggestions on how I shd go about solving the above mentioned problem - not being able to access webpages running on other tomcat servers?

projo 10-12-2003 10:44 PM

You should figure out what is going on but in the mean time will the following work?

/etc/hosts: localhost localhost

If your IP address is

MakingOfAGeek 10-13-2003 12:19 AM

Yes this works, but I still don't know how to access webpages served by other tomcat servers on the same LAN

MakingOfAGeek 10-17-2003 04:14 AM

where ip is the ip address of another machine on the same LAN, results in:

Server Error
The following error occurred:

Could not connect to the server
Please contact the administrator.

pablob 10-18-2003 06:49 AM

My "debugging" always would be:

1- # ping <ip_tomcat_server>
2- # telnet <ip_tomcat_server> 8080

this way you assure:

1- The server's network is working.
2- "Something" is listening on 8080(tomcat) port.

If these two don't work, then the problem is outside your box.

MakingOfAGeek 10-19-2003 08:05 PM

Both work

[root@tmpRH8 SQLBean]# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=128 time=0.359 ms
64 bytes from icmp_seq=2 ttl=128 time=0.194 ms
64 bytes from icmp_seq=3 ttl=128 time=0.171 ms
64 bytes from icmp_seq=4 ttl=128 time=0.196 ms
64 bytes from icmp_seq=5 ttl=128 time=0.191 ms
64 bytes from icmp_seq=6 ttl=128 time=0.195 ms

[1]+ Stopped ping

[root@tmpRH8 SQLBean]# telnet 8080
Connected to
Escape character is '^]'.

pablob 10-25-2003 08:48 AM

so, now we can connect from within the machine itself, but not from outside -->

firewall restrictions ? (New distros come with "autoconfigured firewalls". Check it out)

Also try changing the order within hosts lines:

YOU HAVE /etc/hosts : localhost tmpRH8

try: tmpRH8 localhost

All times are GMT -5. The time now is 05:28 PM.