为什么Tomcat以0.0.0.0:8000开启?

问题描述 投票:0回答:2

我知道简短的回答是“你告诉它了。”但是,当然,我不确定我是怎么告诉Tomcat开始使用8000默认调试端口打开,但是在0.0.0.0而不是预期的127.0.0.1。在Ubuntu 10.10启动后,这里有几个上下文命令。

$ netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN     
tcp6       0      0 127.0.0.1:8080          :::*                    LISTEN     
tcp6       0      0 ::1:631                 :::*                    LISTEN     
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN     

/usr/share/tomcat6/bin$ grep -C 5 8000 catalina.sh
#
#   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
#                   command is executed. The default is "dt_socket".
#
#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. The default is 8000.
#
#   JPDA_SUSPEND    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. Specifies whether JVM should suspend
#                   execution immediately after startup. Default is "n".
#
--
if [ "$1" = "jpda" ] ; then
  if [ -z "$JPDA_TRANSPORT" ]; then
    JPDA_TRANSPORT="dt_socket"
  fi
  if [ -z "$JPDA_ADDRESS" ]; then
    JPDA_ADDRESS="8000"
  fi
  if [ -z "$JPDA_SUSPEND" ]; then
    JPDA_SUSPEND="n"
  fi
  if [ -z "$JPDA_OPTS" ]; then

鉴于这两个输出,我希望发现在某个地方有一个我在不知不觉中被修改的另一个配置文件,因为catalina.sh打开8000的唯一方法是它是否通过了jpda开关,即便如此它似乎将开始localhost,没有0.0.0.0.bashrc是干净的tomcat tomfoolery,我很难在其他地方看!

debugging tomcat ubuntu-10.10 jpda
2个回答
1
投票

是时候刷上RFC4632了,内存生锈了。

0.0.0.0是default route,并且在Tomcat的情况下用于指示端口8000上的任何IP将被路由到Tomcat(可能用于调试)。

重申一下,在Tomcat上,0.0.0.0:xxxx将使用xxxx端口将任何请求路由到Tomcat。


0
投票

这可能是因为JPDA_ADDRESS是“8000”而不是“localhost:8000”,如果[-z“$ JPDA_ADDRESS”];然后JPDA_ADDRESS =“localhost:8000”fi

© www.soinside.com 2019 - 2024. All rights reserved.