0
我知道簡短的答案是「你告訴它。」但是當然,我不知道我是如何告訴Tomcat開始打開8000
默認調試端口,而是在0.0.0.0
而不是預期的127.0.0.1
。在Ubuntu 10.10啓動之後,這裏有幾個上下文命令。爲什麼Tomcat以0.0.0.0:8000打開?
$ 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,我很難看到別的地方看!