今天在使用tomcat搭建solr時想要在啓動時查看日誌,google了下發現原來自己一直在使用直接的啓腳本startup.sh 以及shutdown.sh來啓動和關閉,其實應該使用catalina.sh,該腳本包裝了所有要是要到的命令
Using CATALINA_BASE: /home/kingour/apps/apache-tomcat-6.0.26
Using CATALINA_HOME: /home/kingour/apps/apache-tomcat-6.0.26
Using CATALINA_TMPDIR: /home/kingour/apps/apache-tomcat-6.0.26/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/kingour/apps/apache-tomcat-6.0.26/bin/bootstrap.jar
Usage: catalina.sh ( commands ... )
commands:
debug Start Catalina in a debugger
debug -security Debug Catalina with a security manager
jpda start Start Catalina under JPDA debugger
run Start Catalina in the current window
run -security Start in the current window with security manager
start Start Catalina in a separate window
start -security Start in a separate window with security manager
stop Stop Catalina, waiting up to 5 seconds for the process to end
stop n Stop Catalina, waiting up to n seconds for the process to end
stop -force Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
stop n -force Stop Catalina, wait up to n seconds and then use kill -KILL if still running
version What version of tomcat are you running?
使用 catalina.sh run就表示在當前terminal中運行,並輸出日誌到當前terminal