title: Cannot access Tomcat 5 externally
body: <p>I'm trying to put in a Tomcat server on our unix machine (access remotely) which will be used for test projects.</p>
  
  <p>I used <code>Tomcat 5.0.25</code> (as our production is using the same version).</p>
  
  <p>For now i don't want to run it through Apache and instead just want to access tomcat directly. </p>
  
  <p>So i've deployed Tomcat and configured server.xml (see below) but when i start it i am not able to see the tomcat 5 welcome page using this URL: <code>global.int.com:9082</code></p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  
  &lt;Server port="9007" shutdown="SHUTDOWN"&gt;
  
    &lt;Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
              debug="0"/&gt;
    &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
              debug="0"/&gt;
  
    &lt;!-- Global JNDI resources --&gt;
    &lt;GlobalNamingResources&gt;
  
      &lt;!-- Test entry for demonstration purposes --&gt;
      &lt;Environment name="simpleValue" type="java.lang.Integer" value="30"/&gt;
  
      &lt;!-- Editable user database that can also be used by
           UserDatabaseRealm to authenticate users --&gt;
      &lt;Resource name="UserDatabase" auth="Container"
                type="org.apache.catalina.UserDatabase"
         description="User database that can be updated and saved"&gt;
      &lt;/Resource&gt;
      &lt;ResourceParams name="UserDatabase"&gt;
        &lt;parameter&gt;
          &lt;name&gt;factory&lt;/name&gt;
          &lt;value&gt;org.apache.catalina.users.MemoryUserDatabaseFactory&lt;/value&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;name&gt;pathname&lt;/name&gt;
          &lt;value&gt;conf/tomcat-users.xml&lt;/value&gt;
        &lt;/parameter&gt;
      &lt;/ResourceParams&gt;
  
    &lt;/GlobalNamingResources&gt;
  
    &lt;Service name="Catalina"&gt;
  
  
      &lt;Connector port="9082" protocol="HTTP/1.1" 
                 connectionTimeout="20000" 
                 redirectPort="8443" /&gt;
  
  
      &lt;!-- Define an AJP 1.3 Connector on port 8009 --&gt;
      &lt;Connector port="9020" protocol="AJP/1.3" redirectPort="9444" /&gt;
  
  
      &lt;!-- An Engine represents the entry point (within Catalina) that processes
           every request.  The Engine implementation for Tomcat stand alone
           analyzes the HTTP headers included with the request, and passes them
           on to the appropriate Host (virtual host).
           Documentation at /docs/config/engine.html --&gt;
  
      &lt;!-- You should set jvmRoute to support load-balancing via AJP ie :
      &lt;Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"&gt;         
      --&gt; 
      &lt;Engine name="Catalina" defaultHost="localhost"&gt;
  
  
        &lt;!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  --&gt;
        &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/&gt;
  
        &lt;!-- Define the default virtual host
             Note: XML Schema validation will not work with Xerces 2.2.
         --&gt;
        &lt;Host name="localhost"  appBase="webapps"
              unpackWARs="true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="false"&gt;
  
        &lt;/Host&gt;
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  </code></pre>
  
  <p>I can see Tomcat is running as Catalina.out says:</p>
  
  <p><code>Jan 27, 2012 8:21:56 PM org.apache.coyote.http11.Http11Protocol start
  INFO: Starting Coyote HTTP/1.1 on http-9082
  Jan 27, 2012 8:21:56 PM org.apache.jk.common.ChannelSocket init
  INFO: JK2: ajp13 listening on /0.0.0.0:9020
  Jan 27, 2012 8:21:56 PM org.apache.jk.server.JkMain start
  INFO: Jk running ID=0 time=1/14  config=/home/tomcat/tomcat5_fcl_uat/conf/jk2.properties
  Jan 27, 2012 8:21:56 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 2173 ms</code></p>
  
  <p>And Command  <code>lsof -i TCP</code> Shows:</p>
  
  <p><code>java      29923      tomcat    5u  IPv6 373023       TCP *:9082 (LISTEN)</code></p>
  
  <p>I can't figure out why i can't see the tomcat page. I have another Tomcat server running on port 9081 and we can access it just fine by using url <code>global.int.com:9081</code>  and the above server.xml is a carbon copy of that except the port numbers are changed. Can anyone please give me a hint on where things are falling apart. Thanks </p>
  
  <h2>UPDATE2:</h2>
  
  <p>Result of <code>wget -S</code> from <strong>Remote Desktop</strong>:</p>
  
  <pre><code>    --2012-01-30 17:35:42--  http://global.int.com:9082/
      Resolving global.int.com... 10.215.222.78
      Connecting to global.int.com|10.215.222.78|:9082... failed: No route
      to host.
  </code></pre>
  
  <p>Below is the result of <code>wget -S</code> on <strong>LocalHost machine:</strong></p>
  
  <pre><code>    [tomcat@global logs]$ wget -S  http://global.int.com:9082/
      --16:17:03--  http://global.int.com:9082/
      Resolving global.int.com:9082... 10.213.210.78
      Connecting to global.int.com:9082|10.213.210.78|:9082... connected.
      HTTP request sent, awaiting response...
        HTTP/1.1 200 OK
        Content-Type: text/html;charset=ISO-8859-1
        Date: Sat, 28 Jan 2012 05:17:03 GMT
        Server: Apache-Coyote/1.1
        Connection: close
      Length: unspecified [text/html]
      Saving to: `index.html'
  
          [ &lt;=&gt;                                                                                          ] 9,312       --.-K/s   in 0s
  
      16:17:03 (297 MB/s) - `index.html' saved [9312]
  
      [tomcat@global logs]$
  </code></pre>
  
  <h2>UPDATE 3: Result of <code>iptables -L -v -n</code>:</h2>
  
  <pre><code>  106  5920 ACCEPT     tcp  --  *      *       10.0.0.0/8           0.0.0.0/0           tcp dpt:8080
      6   312 ACCEPT     tcp  --  *      *       10.0.0.0/8           0.0.0.0/0           tcp dpt:8180
      0     0 ACCEPT     tcp  --  *      *       10.0.0.0/8           0.0.0.0/0           tcp dpt:9080
     19   988 ACCEPT     tcp  --  *      *       10.0.0.0/8           0.0.0.0/0           tcp dpt:9081
  </code></pre>
  
  <p>Correct me if I am wrong - but result of above shows the reason why I cannot access tomcat given I've assigned port 9082 to tomcat and that port does not exist in the above list. </p>
  
  <p>All port numbers used in <code>server.xml</code> are unique (I've double checked). Any suggestions on why I can't get to see the Tomcat main page and how to fix it? </p>