We help IT Professionals succeed at work.

Can't access Tomcat using IP Address

I've installed Fedora 8 on a new box along with Apache and Tomcat 5.5.25.  I'm just running it on a LAN behind a Netopia DSL modem/router so have no domain name.  I can access the Apache pages on port 80 from the same box and other computers on the network.  I started Tomcat on port 8080 and can access the main page using http://localhost:8080/ and http://127.0.0.1:8080/ and http:captnmurray:8080/ (which is the machine name) but can't access The Tomcat pages using the IP address of the same machine or any other.  I have static IPs and I'm pretty sure it isn't a firewall issue since I disabled the firewall, added port 8080 to the firewall, and disabled SELinux and still the same issue.  I've tried changing the router to clear sailing and no change.

I'm sure there's some configuration that isn't set right.  I'm not a Linux expert and have no experience setting up these servers so any help would be appreciated.
Comment
Watch Question

Author

Commented:
Here's some additional information:

I was able to edit the server_8080.xml file and changed the 127.0.0.1 to my real IP address and I was able to connect from the same and other boxes.  Is this normal procedure for setting up Tomcat to work with real clients, i.e. other than on the local box?

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector address="###.###.###.###" port="8080"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true"
               allowTrace="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to 0 -->

Commented:
Well yea, you need it to bind to the WAN address instead of the Loopback address for it to work. Well change the IP to your WAN if you want to access it over the internet.

Author

Commented:
Yes, I should have known that, since it's so well documented...(NOT).  
Linux documentation: Download it, install it, run it, Google for help to make it work.

Open in new window

system administrator
Top Expert 2007
Commented:
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

According to this document if you omit 'address' tag, your server will listen on all addresses. I don't know does Fedora 8 uses server_8080.xml as a main configuration file, but by default it is server.xml.

This docs also quite helpful.
http://wiki.apache.org/tomcat/FAQ/Connectors
http://tomcat.apache.org/tomcat-5.5-doc/config/index.html

Author

Commented:
Thanks.  That's much better.  server_8080.xml is used by the application I'm trying to run.  It copies it over server.xml and then starts Tomcat.