• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot Connect to Tomcat Externally

 
Kris van der Starren
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kris van der Starren
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic