aspose file tools*
The moose likes Tomcat and the fly likes Cannot Connect to Tomcat Externally Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot Connect to Tomcat Externally" Watch "Cannot Connect to Tomcat Externally" New topic
Author

Cannot Connect to Tomcat Externally

Kris van der Starren
Greenhorn

Joined: Oct 25, 2010
Posts: 6
I have a Java application deployed in Tomcat 6 on fresh install of Ubuntu 10 Server Edition. Judging by the catalina.out file, the application seems to be starting fine, but I can't get to it on the external IP address for the box. I've been reading online and think that it might have something to do with Tomcat not being bound to the external IP, but I'm not sure what I need to check to see if that's the case.

Do you have to do something to tell Tomcat to listen on an external IP?


Cheers, Kris
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

Linux normally installs with a firewall, which is almost always the netfilter iptables firewall these days. You have to open up port 8080 for tcp input in that firewall before external users can talk to tomcat.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kris van der Starren
Greenhorn

Joined: Oct 25, 2010
Posts: 6
Thanks for the response Tim. I found out that the problem was related to the fact that there was no connector for the external ip address in the server.xml file. Once I added the following line, everything was fine.

<Connector address="xxx.xxx.xxx.xxx"/> (where xxx.xxx.xxx.xxx was my external ip address)


Cheers, Kris
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

Kris van der Starren wrote:Thanks for the response Tim. I found out that the problem was related to the fact that there was no connector for the external ip address in the server.xml file. Once I added the following line, everything was fine.

<Connector address="xxx.xxx.xxx.xxx"/> (where xxx.xxx.xxx.xxx was my external ip address)


Cheers, Kris


You should not have had to set that feature. It's used to limit the connector to ONLY listen on that IP address, and that's a feature that's rarely used.

The default Connector behaviour is to listen on ALL IP addresses, and is what most people want.
Kris van der Starren
Greenhorn

Joined: Oct 25, 2010
Posts: 6
Hi Tim. Is there something else I should have tried? I'm willing to try something else but right when I put that in, everything started working.

Cheers, Kris
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

Try pulling it back out again. See if it keeps working. If so, you had aleady fixed the problem without realizing it. If not, there's something interesting going on in your network routing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot Connect to Tomcat Externally