Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We hire a Virtual MS Server 2008 machine from a hosting company. I say this because maybe it's got a bunch of extra settings that aren't the "vanilla" 2008 settings.

Anyway, I installed a default installation of Tomcat 6.0, and have got it running all good on the server.

I can access it via localhost:8080, or xxx.xxx.xxx.xxx:8080.

However, when I try and access this from machine at home using the static IP address it doesn't work. why?

I thought it might have been the Windows firewall so I create a new inbound rule for port 8080.

still doesn't work, I just get nothing from the browser, like it can't connect to that IP address.

However, when I put just the IP address (i.e. port 80), it resolves the DNS fine and goes to our ASP.NET IIS app... so, what's wrong?

UPDATE:

here's my tomcat server.xml:

    <?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443"
               URIEncoding="UTF-8"/>
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->           
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- 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 -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- 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.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost" appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>
share|improve this question

4 Answers 4

Have you actually enabled Tomcat to listen on the eth0 port, rather than just the localhost port. If you can just access it via the localhost (even when you type in the IP addresses it still goes to the local host) but not externally, this is normally the case.

<Host name="www.example.com" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="."/>

Put this after the other host line but before the line, but remember to change the domain to the domain name your are connecting to it by.

share|improve this answer
    
cool, i think that's it. but what do you mean? could you provide a step by step? How do I enable tomcat to do this? cheers! –  andy Dec 31 '09 at 5:05
    
check you didn't explicitly tell tomcat to listen only on 127.0.0.1:8080, this is configurable by address field of http connector in server.xml: tomcat.apache.org/tomcat-5.5-doc/config/http.html –  Stephen Thompson Dec 31 '09 at 5:14
    
@stephen. hey stephen, just posted my current server.xml. I'm specifying a specific address.... should I be? cheers –  andy Dec 31 '09 at 9:31
    
@stephen. hey stephen, tried that, but still nothing...? –  andy Jan 8 '10 at 0:57

For future visitors: I had a similar problem on a Linux server and none of the "solutions" I've found helped.

Finally, I found that I just had firewall settings that blocked that port.

share|improve this answer

You have to tell the Connector in the server.xml file, that you want to use it on every port, not only on 127.0.0.1 by changing the address attribute's value to 0.0.0.0

<Connector port="8080" protocol="HTTP/1.1" 
           maxHttpHeaderSize="65536" 
           connectionTimeout="20000" 
           redirectPort="8443"
           address="0.0.0.0" />

Shutdown and startup the tomcat after that

See also: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

share|improve this answer
    
Thanks for the answer yunzen. I'd love to see this as the answer but this was so long ago I don't know how to even replicate the issue to see if your solution works... :-/ I could try setting up Apache on a windows virtual machine.... –  andy Nov 4 at 22:22
    
@andy there exists a TYPO3 extension named solr which contains an install script which installs tomcat and solr automatically. forge.typo3.org/projects/extension-solr/wiki/Setup_on_*NIX –  yunzen Nov 4 at 22:25

Have you checked if there are any external firewalls at your hosting provider?

Maybe they are blocking port 8080, and not port 80.

An easy way to test would be to make tomcat listen on port 80, and see if it responds.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.