如何使用两个单独的端口 运行 windows 上 tomcat 的两个实例

How to run two instances of tomcat on windows using two separate ports

我想 运行 两个 apache 实例 tomcat 7.0.x 在同一台 windows 机器上,但使用端口 8080(一个 tomcat实例)在 8090(另一个 tomcat 实例)上。

当我尝试使用 windows CMD 使用两个不同的端口同时 运行 两个实例时,出现以下错误。请让我知道发生了什么问题。

    [![Several ports (8005, 8009) required by Tomcat v7.0 Server at localhost are 
already in use. The server may already be running in another process, or a 
system process may be using the port. To start this server you will need to stop 
the other process or change the port number(s).][1]][1]

截图供参考:-

默认配置的 tomcat 使用 3 个端口 8080、8009 和 8005。因此,如果您想在同一台机器上启动另一个 tomcat 服务器,您必须同样编辑 server.xml tomcat 并将这些端口值更改为例如 8090、8019 和 8015。仅将 8080 更改为 8090 将不起作用。

将以下端口修改为server.xml中的一些其他值,您可以在{Tomcat安装文件夹}\conf.

中找到
  1. 连接器端口:8080(默认)
  2. 关机端口:8005(默认)AJP
  3. 端口:8009(默认)
  4. 重定向端口:8100(默认)

请使用此 link 了解更多详情。

您正在使用 Eclipse。双击 servers 选项卡中的 server。并编辑这三个端口并确保两个服务器的这些端口不同。

还有一个方面:

根据您的设置,您可以

  • 禁用(注释掉)ajp13 端口(默认 8009)
  • 禁用关闭端口(设置为 -1)

这实际上会将您的 server.xml 减少到一个要更改的端口。