LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-05-2003, 06:28 AM   #1
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Rep: Reputation: 0
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
 
Old 10-05-2003, 08:25 AM   #2
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
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.
 
Old 10-06-2003, 01:05 AM   #3
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
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
 
Old 10-06-2003, 11:01 AM   #4
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
Why is there that 169.254.0.0 eth0 route ?
 
Old 10-06-2003, 11:57 AM   #5
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
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"
 
Old 10-06-2003, 12:05 PM   #6
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
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 ???
 
Old 10-07-2003, 04:13 AM   #7
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
No theres just one ethernet card

Could you tell me why netstat -nr shows a 10.90.44.0 ?
 
Old 10-09-2003, 04:28 PM   #8
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
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 )"
 
Old 10-12-2003, 11:10 PM   #9
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
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?
 
Old 10-12-2003, 11:44 PM   #10
projo
LQ Newbie
 
Registered: Oct 2003
Location: Mississippi
Posts: 5

Rep: Reputation: 0
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
 
Old 10-13-2003, 01:19 AM   #11
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
Yes this works, but I still don't know how to access webpages served by other tomcat servers on the same LAN
 
Old 10-17-2003, 05:14 AM   #12
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
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.
 
Old 10-18-2003, 07:49 AM   #13
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
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.
 
Old 10-19-2003, 09:05 PM   #14
MakingOfAGeek
LQ Newbie
 
Registered: Oct 2003
Posts: 12

Original Poster
Rep: Reputation: 0
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 '^]'.
 
Old 10-25-2003, 09:48 AM   #15
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to run Teamspeak 2 server, installed traermedic Linux - Software 0 09-18-2005 11:07 PM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 02:30 PM
Unable to login as local user with vsftpd running on the server kairamr Linux - Newbie 1 06-09-2004 03:25 PM
run vnc-server as other user in rc.local jvdbossc Linux - Newbie 2 05-26-2004 03:10 AM
Local Host Webpage littlebradley Linux - Software 4 05-09-2003 09:39 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration