LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to run webpage on local server using ip in the url (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-run-webpage-on-local-server-using-ip-in-the-url-100402/)

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
127.0.0.1 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
169.254.0.0 0.0.0.0 255.255.255.0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 lo

This way you tell: "All the packets travelling to hosts beginning with 169.254...., use eth0 interface (network card)"
"All packets to 127.0.0.1 (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:
127.0.0.1 localhost
10.90.45.87 tmpRH8

netstat -nr gives:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.90.44.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.90.44.1 0.0.0.0 UG 0 0 0 eth0

I still have the same problem

pablob 10-06-2003 10:01 AM

Why is there that 169.254.0.0 eth0 route ?

MakingOfAGeek 10-06-2003 10:57 AM

I dont know... I dont know how a 10.90.44.0 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 10.90.44.0 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 10.90.44.0 ?

pablob 10-09-2003 03:28 PM

Well, that is the only "normal" thing:

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

Look:
Destination Gateway Genmask Flags MSS Window irtt Iface
10.90.44.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
0.0.0.0 10.90.44.1 0.0.0.0 UG 0 0 0 eth0

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

MakingOfAGeek 10-12-2003 10:10 PM

yes 10.90.44.1 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:
127.0.0.1 localhost
10.90.45.87 localhost

If your IP address is 10.90.45.87

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

http://<ip>/examples/asd.jsp
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 10.90.45.111
PING 10.90.45.111 (10.90.45.111) 56(84) bytes of data.
64 bytes from 10.90.45.111: icmp_seq=1 ttl=128 time=0.359 ms
64 bytes from 10.90.45.111: icmp_seq=2 ttl=128 time=0.194 ms
64 bytes from 10.90.45.111: icmp_seq=3 ttl=128 time=0.171 ms
64 bytes from 10.90.45.111: icmp_seq=4 ttl=128 time=0.196 ms
64 bytes from 10.90.45.111: icmp_seq=5 ttl=128 time=0.191 ms
64 bytes from 10.90.45.111: icmp_seq=6 ttl=128 time=0.195 ms

[1]+ Stopped ping 10.90.45.111



[root@tmpRH8 SQLBean]# telnet 10.90.45.111 8080
Trying 10.90.45.111...
Connected to 10.90.45.111.
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 :

127.0.0.1 localhost
10.90.45.87 tmpRH8

try:

10.90.45.87 tmpRH8
127.0.0.1 localhost


All times are GMT -5. The time now is 08:20 PM.