Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Cannot Connect to Tomcat Externally

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic