Tomcat 6 only localhost通过IP连接从另一个框返回200,但返回403?

Tomcat 6 only localhost通过IP连接从另一个框返回200,但返回403?,tomcat,ubuntu,tomcat6,Tomcat,Ubuntu,Tomcat6,我正在尝试设置blackberry推送服务器,它在Tomcat6中运行。安装程序执行得很好,一切正常 但是,我只能从本地机器连接到它,我可以使用盒子中的链接或wget来证明这一点。因此,localhost:8080按预期返回默认的Tomcat页面,web管理器等运行正常 一旦我尝试通过ip连接到它,例如,它连接到Tomcat,但返回403,显示- 说明已禁止访问指定的资源() 这已经被记录下来了 因此,看起来这不是网络问题,而是Tomcat配置问题。我一直在看这些文件,觉得我忽略了一些愚蠢的简单

我正在尝试设置blackberry推送服务器,它在Tomcat6中运行。安装程序执行得很好,一切正常

但是,我只能从本地机器连接到它,我可以使用盒子中的链接或wget来证明这一点。因此,localhost:8080按预期返回默认的Tomcat页面,web管理器等运行正常

一旦我尝试通过ip连接到它,例如,它连接到Tomcat,但返回403,显示-

说明已禁止访问指定的资源()

这已经被记录下来了

因此,看起来这不是网络问题,而是Tomcat配置问题。我一直在看这些文件,觉得我忽略了一些愚蠢的简单的事情。我试过了

  • ipaddresshere
    到server.xml,在locathost
  • 尝试更改
    部分的name属性
  • 添加名称为IP地址的单独
  • 每次更改后,我都会运行shutdown.sh,然后运行startup.sh,这些都会恢复正常

    这是我的server.xml

    <?xml version='1.0' encoding='utf-8'?>
    
    除非适用法律要求或书面同意,软件 根据许可证进行的分发是按“原样”进行分发的, 无任何明示或暗示的保证或条件。 请参阅许可证以了解管理权限和权限的特定语言 许可证下的限制。 -->

    
    IPADDRESSHERE
    黑莓
    

    此服务器仅供内部网络使用


    有人能看出我这里出了问题,我再次确信这是tomcat配置的问题。我正在运行Ubuntu10.04 LTS,并通过apt进行所有最新更新。

    一旦我在这里提出问题,我似乎总能找到解决方案,所以

    无论如何,这是一个与localhost一起添加第二个
    的案例。这在第一次就不起作用了,我不知道为什么,也许Tomcat在这次改变后没有恢复干净

    因此,在localhost下面添加以下内容:

    <Host name="10.100.9.170" appBase="webapps" unpackWARs="true" autodeploy="true" xmlValidation="false" >
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="10-100-9-170_access_log." suffix=".txt" pattern="common" resolveHosts="true"  />
      </Host>
    
    
    

    成功了。

    403是授权失败-您试图访问的web应用程序的web.xml是否在某个地方在线可用,或者是整个tomcat捆绑包(您可以链接到它们,或者是我们可以跟踪的Blackberry页面?)
    <!--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" useBodyEncodingForURI="true" />
    <!-- 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" 
               keystoreFile="keystores/.keystore" keystorePass="changeit" 
           clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"/>
    
    
    <!-- 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="Catalina" 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">
    <Alias>IPADDRESSHERE</Alias>
    <Alias>CL-Blackberry</Alias>
        <!-- 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="true"  />
    
      </Host>
    </Engine>
    
    <Host name="10.100.9.170" appBase="webapps" unpackWARs="true" autodeploy="true" xmlValidation="false" >
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="10-100-9-170_access_log." suffix=".txt" pattern="common" resolveHosts="true"  />
      </Host>