Tomcat运行在8080端口,但无法使用IP地址远程访问?

2023-12-30

我在我的服务器上新安装了 apache-tomcat-7.0.62。 当我启动 tomcat 时,它启动时没有错误,但是当我想使用浏览器访问它时,它说页面不可用。我使用以下命令来检查 tomcat 是否正常运行:-

     netstat -ntlp | grep LISTEN

以下是输出:-

tcp 0 0 0.0.0.0:22 0.0.0.0:* 听 -
tcp 0 0 127.0.0.1:8005 0.0.0.0:* 监听 19430/java
tcp 0 0 0.0.0.0:8009 0.0.0.0:* 监听 19430/java
tcp 0 0 127.0.0.1:3306 0.0.0.0:* 听 -
tcp 0 0 0.0.0.0:8080 0.0.0.0:* 监听 19430/java
tcp6 0 0 :::22 :::* 听 -
tcp6 0 0 :::8000 :::* 听 -
tcp6 0 0 :::80 :::* 听 -

以下是内容卡特琳娜.out

 Aug 28, 2015 7:56:39 AM               org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.62
Aug 28, 2015 7:56:39 AM    org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          May 7 2015 17:14:55 UTC
Aug 28, 2015 7:56:39 AM     org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.62.0
Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
  Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
  INFO: OS Version:            3.13.0-48-generic
 Aug 28, 2015 7:56:39 AM      org.apache.catalina.startup.VersionLoggerListener log
 INFO: Architecture:          amd64
   Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
 INFO: Java Home:             /usr/lib/jvm/java-7-openjdk-amd64/jre
 Aug 28, 2015 7:56:39 AM      org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_79-b14
 Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation 
Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /home/ubuntu/apache-tomcat-7.0.62
Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /home/ubuntu/apache-tomcat-7.0.62
Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: - Djava.util.logging.config.file=/home/ubuntu/apache-tomcat- 7.0.62/conf/logging.properties
 Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
 INFO: Command line argument: - Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.net.preferIPv4Stack=true 
 Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.net.preferIPv4Addresses=true
Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/home/ubuntu/apache- tomcat-7.0.62/endorsed
Aug 28, 2015 7:56:39 AM  org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/home/ubuntu/apache-     tomcat-7.0.62
Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/home/ubuntu/apache- tomcat-7.0.62
 Aug 28, 2015 7:56:39 AM   org.apache.catalina.startup.VersionLoggerListener log
 INFO: Command line argument: -Djava.io.tmpdir=/home/ubuntu/apache-   tomcat-7.0.62/temp
 Aug 28, 2015 7:56:39 AM org.apache.catalina.core.AprLifecycleListener  lifecycleEvent
  INFO: The APR based Apache Tomcat Native library which allows optimal     performance in production environments was not found on the   java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-  gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-  gnu:/usr/lib/jni:/lib:/usr/lib
 Aug 28, 2015 7:56:39 AM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["http-bio-8080"]
 Aug 28, 2015 7:56:39 AM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
 Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 1060 ms
 Aug 28, 2015 7:56:39 AM org.apache.catalina.core.StandardService     startInternal
 INFO: Starting service Catalina
  Aug 28, 2015 7:56:39 AM org.apache.catalina.core.StandardEngine   startInternal
 INFO: Starting Servlet Engine: Apache Tomcat/7.0.62
 Aug 28, 2015 7:56:39 AM org.apache.catalina.startup.HostConfig  deployDirectory
INFO: Deploying web application directory /home/ubuntu/apache-tomcat- 7.0.62/webapps/ROOT
Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig  deployDirectory
 INFO: Deployment of web application directory /home/ubuntu/apache - tomcat-7.0.62/webapps/ROOT has finished in 805 ms
 Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig    deployDirectory
 INFO: Deploying web application directory /home/ubuntu/apache-tomcat- 7.0.62/webapps/examples
 Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig  deployDirectory
 INFO: Deployment of web application directory /home/ubuntu/apache-  tomcat-7.0.62/webapps/examples has finished in 611 ms
 Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig  deployDirectory
 INFO: Deploying web application directory /home/ubuntu/apache-tomcat-  7.0.62/webapps/host-manager
  Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig   deployDirectory
 INFO: Deployment of web application directory /home/ubuntu/apache- tomcat-7.0.62/webapps/host-manager has finished in 204 ms
Aug 28, 2015 7:56:40 AM org.apache.catalina.startup.HostConfig  deployDirectory
INFO: Deploying web application directory /home/ubuntu/apache-tomcat    -7.0.62/webapps/manager
 Aug 28, 2015 7:56:41 AM org.apache.catalina.startup.HostConfig    deployDirectory
 INFO: Deployment of web application directory /home/ubuntu/apache- tomcat-7.0.62/webapps/manager has finished in 107 ms
Aug 28, 2015 7:56:41 AM org.apache.catalina.startup.HostConfig  deployDirectory
INFO: Deploying web application directory /home/ubuntu/apache-tomcat-  7.0.62/webapps/docs
Aug 28, 2015 7:56:41 AM org.apache.catalina.startup.HostConfig   deployDirectory
 INFO: Deployment of web application directory /home/ubuntu/apache-  tomcat-7.0.62/webapps/docs has finished in 115 ms
 Aug 28, 2015 7:56:41 AM org.apache.coyote.AbstractProtocol start
 INFO: Starting ProtocolHandler ["http-bio-8080"]
 Aug 28, 2015 7:56:41 AM org.apache.coyote.AbstractProtocol start
 INFO: Starting ProtocolHandler ["ajp-bio-8009"]
 Aug 28, 2015 7:56:41 AM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1960 ms

以下是内容服务器.xml file

<?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">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--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" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- 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" 
	useIPVHosts="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 BIO implementation that requires the JSSE
         style configuration. When using the APR/native implementation, the
         OpenSSL style configuration is required as described in the APR/native
         documentation -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" 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="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"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- 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"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- 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
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>


	<Host name="mining.knowaptitude.in"  appBase="mining_apps"
            unpackWARs="true" autoDeploy="true">

        <!-- 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
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>

    </Engine>
  </Service>
</Server>

请检查8080端口是否可以从外部访问。端口可能被阻止。检查您的防火墙设置并打开 http 请求的端口。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Tomcat运行在8080端口,但无法使用IP地址远程访问? 的相关文章

  • 为什么 JTables 使 TableModel 在呈现时不可序列化?

    所以最近我正在开发一个工具 供我们配置某些应用程序 它不需要是什么真正令人敬畏的东西 只是一个具有一些 SQL 脚本生成功能并创建几个 XML 文件的基本工具 在此期间 我使用自己的 AbstractTableModel 实现创建了一系列
  • 如何获取之前的URL?

    我需要调用我的网络应用程序的 URL 例如 如果有一个从 stackoverflow com 到我的网站 foo com 的链接 我需要 Web 应用程序 托管 bean 中的 stackoverflow 链接 感谢所有帮助 谢谢 并不总是
  • 谷歌应用程序引擎会话

    什么是java应用程序引擎 默认会话超时 如果我们将会话超时设置为非常非常长的时间 会不会产生不良影响 因为谷歌应用程序引擎会话默认情况下仅存储在数据存储中 就像facebook一样 每次访问该页面时 会话仍然永远存在 默认会话超时设置为
  • 在接口中使用默认方法是否违反接口隔离原则?

    我正在学习 SOLID 原则 ISP 指出 客户端不应被迫依赖于他们所使用的接口 不使用 在接口中使用默认方法是否违反了这个原则 我见过类似的问题 但我在这里发布了一个示例 以便更清楚地了解我的示例是否违反了 ISP 假设我有这个例子 pu
  • 没有 Spring 的自定义 Prometheus 指标

    我需要为 Web 应用程序提供自定义指标 问题是我不能使用 Spring 但我必须使用 jax rs 端点 要求非常简单 想象一下 您有一个包含键值对的映射 其中键是指标名称 值是一个简单的整数 它是一个计数器 代码会是这样的 public
  • 帮助将图像从 Servlet 获取到 JSP 页面 [重复]

    这个问题在这里已经有答案了 我目前必须生成一个显示字符串文本的图像 我需要在 Servlet 上制作此图像 然后以某种方式将图像传递到 JSP 页面 以便它可以显示它 我试图避免保存图像 而是以某种方式将图像流式传输到 JSP 自从我开始寻
  • volatile、final 和synchronized 安全发布的区别

    给定一个带有变量 x 的 A 类 变量 x 在类构造函数中设置 A x 77 我们想将 x 发布到其他线程 考虑以下 3 种变量 x 线程安全 发布的情况 1 x is final 2 x is volatile 3 x 设定为同步块 sy
  • tomcat 中受密码保护的应用程序

    我正在使用 JSP Servlet 开发一个Web应用程序 并且我使用了Tomcat 7 0 33 as a web container 所以我的要求是tomcat中的每个应用程序都会password像受保护的manager applica
  • logcat 中 mSecurityInputMethodService 为 null

    我写了一点android应显示智能手机当前位置 最后已知位置 的应用程序 尽管我复制了示例代码 并尝试了其他几种解决方案 但似乎每次都有相同的错误 我的应用程序由一个按钮组成 按下按钮应该log经度和纬度 但仅对数 mSecurityInp
  • 获取文件的总大小(以字节为单位)[重复]

    这个问题在这里已经有答案了 可能的重复 java 高效获取文件大小 https stackoverflow com questions 116574 java get file size efficiently 我有一个名为 filenam
  • 为什么 Java 8 不允许非公共默认方法?

    让我们举个例子 public interface Testerface default public String example return Hello public class Tester implements Testerface
  • java for windows 中的文件图标叠加

    我正在尝试像 Tortoise SVN 或 Dropbox 一样在文件和文件夹上实现图标叠加 我在网上查了很多资料 但没有找到Java的解决方案 Can anyone help me with this 很抱歉确认您的担忧 但这无法在 Ja
  • java.io.Serialized 在 C/C++ 中的等价物是什么?

    C C 的等价物是什么java io Serialized https docs oracle com javase 7 docs api java io Serializable html 有对序列化库的引用 用 C 序列化数据结构 ht
  • Android:无法使用 DbHelper 和 Contract 类将数据插入 SQLite

    public class Main2Activity extends AppCompatActivity private EditText editText1 editText2 editText3 editText4 private Bu
  • 干净构建 Java 命令行

    我正在使用命令行编译使用 eclipse 编写的项目 如下所示 javac file java 然后运行 java file args here 我将如何运行干净的构建或编译 每当我重新编译时 除非删除所有内容 否则更改不会受到影响 cla
  • 如何使用mockito模拟构建器

    我有一个建造者 class Builder private String name private String address public Builder setName String name this name name retur
  • CamcorderProfile.videoCodec 返回错误值

    根据docs https developer android com reference android media CamcorderProfile html 您可以使用CamcorderProfile获取设备默认视频编解码格式 然后将其
  • 使用 svn 1.8.x、subclise 1.10 的 m2e-subclipse 连接器在哪里?

    我读到 m2e 的生产商已经停止生产 svn 1 7 以外的任何版本的 m2e 连接器 Tigris 显然已经填补了维护 m2e subclipse 连接器的空缺 Q1 我的问题是 使用 svn 1 8 x 的 eclipse 更新 url
  • 双枢轴快速排序和快速排序有什么区别?

    我以前从未见过双枢轴快速排序 是快速排序的升级版吗 双枢轴快速排序和快速排序有什么区别 我在 Java 文档中找到了这个 排序算法是双枢轴快速排序 作者 弗拉基米尔 雅罗斯拉夫斯基 乔恩 本特利和约书亚 布洛赫 这个算法 在许多数据集上提供
  • Java中super关键字的范围和使用

    为什么无法使用 super 关键字访问父类变量 使用以下代码 输出为 feline cougar c c class Feline public String type f public Feline System out print fe

随机推荐