0

This is the same question asked here. I don't know if this issue was resolved. I am unable to connect to my local server from other network PCs.

I am using Eclipse with Tomcat to run my web application. It is a simple demo html page with no server code. It is opening in my own system when I am using http://localhost:8080 or my static ip as http://9.184.21.239:8080. But if I try to access this page from another PC on the same network, I get network timeout error. I am using Ubuntu 11 whereas other network PCs are using Windows. Those PCs are able to ping my IP and get a reply, only the web page do not come in the browser. Are there any firewall settings or any other settings I need to do for Network PCs to be able to access my server?

5
  • Do you have any proxy settings in your browser?
    – Khaled
    Dec 7, 2011 at 9:01
  • There is no proxy setting in browser, and network is also not configured for any proxy server.
    – Rishi P
    Dec 7, 2011 at 9:03
  • Are you able to connect to port 8080 from the client? i.e nc 9.184.21.239 8080 ?, if not check to see if iptables is blocking that port in the INPUT chain Dec 8, 2011 at 2:09
  • You mean like "ping 9.184.21.239:8080". If I am trying to ping the particular port, it does not reply. However, "ping 9.184.21.239" replies. Can you tell me how to check the iptables is blocking any port? Sorry if it sounds like a dumb question, but I am new to Linux also.
    – Rishi P
    Dec 12, 2011 at 6:06
  • You can't use the ping utility to check a tcp port. And by default I believe Ubuntu uses UFW and not iptables. It really sounds like you've bitten off more than you can chew.
    – Safado
    Dec 20, 2011 at 21:20

2 Answers 2

0

If they are getting a 404 error that means that the clients are connecting to a webserver somewhere.

I'm not overly familiar with tomcat, but it should be logging the access somewhere - even if it is a 404 response - so the first step is to check to see if the request is getting to your machine. After that, it s a problem with your code / config. Most likely you've not configured a vhost for the name.

What does your server.xml look like?

4
  • It's not exactly Page not found 404 error. It is rather getting timed out. Firefox says connecting to my IP, and after a few seconds, it says the request timed out and the resource may not be available or some such message. I haven't modified the server.xml. It's the same as when I downloaded Tomcat. I think it's not connecting to my server at all because I don't see any logs at the server console inside Eclipse.
    – Rishi P
    Dec 7, 2011 at 9:40
  • "I get Page not found error" - we're only able to advise on the errors you report. Check your firewall config.
    – symcbean
    Dec 11, 2011 at 11:27
  • Sorry about that. Have edited my question now. Can you advise on what exactly am I looking for in firewall settings?
    – Rishi P
    Dec 12, 2011 at 6:03
  • You're looking for whether port 8080 is open for those within your same subnet.
    – Safado
    Dec 20, 2011 at 21:17
0

This is somewhat like a problem I experienced - I could connect locally just fine, but trying to hit it from another computer on the same network always failed.

Turns out my primary interface (eth0) was NOT automatically connecting when the system booted. When tomcat starts, it binds to all known interfaces - so it never bound to my external IP address, only 127.0.0.1. Later, when I started the interface and got an IP address from the DHCP server, tomcat was already running and unaware of the new IP.

Solution? Stop tomcat, make sure all of your interfaces are connected with valid IP addresses, and then restart tomcat.

1
  • To further investigate along these lines, in a terminal type netstat -ant and see if anything is listening on port 8080 for the desired IP address. If it's not listed, then you'll know that something is wrong with the tomcat config, or as stated above, just needs a restart.
    – Safado
    Dec 20, 2011 at 21:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .