What determines the current working directory of Tomcat Java process?

前端 未结 2 1954
遇见更好的自我
遇见更好的自我 2021-01-02 14:36

My production server runs Linux using System V style init scripts.

Tomcat is brought up by running service tomcat6 start as root user (service

2条回答
  •  半阙折子戏
    2021-01-02 15:22

    Did you see the variables?

    • CATALINA_HOME: This represents the root of your Tomcat installation. When we say, "This information can be found in your CATALINA_HOME/README.txt file" we mean to look at the README.txt file at the root of your Tomcat install.

    • CATALINA_BASE Optionally, Tomcat may be configured for multiple instances by defining $CATALINA_BASE for each instance. If multiple instances are not configured, CATALINA_BASE is the same as CATALINA_HOME.

    In the file apache-tomcat-7.0.42/bin/catalina.sh you will see:

    # Only set CATALINA_HOME if not already set
    [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
    
    # Copy CATALINA_BASE from CATALINA_HOME if not already set
    [ -z "$CATALINA_BASE" ] && CATALINA_BASE="$CATALINA_HOME"
    

提交回复
热议问题