问题
I am unable to set setenv.sh
file working. Can anyone help me to set it on server.
SETENVPATH="${CATALINA_BASE:-$CATALINA_HOME}" if [ -r "$SETENVPATH/bin/setenv.sh" ]; then . "$SETENVPATH/bin/setenv.sh" elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then . "$CATALINA_HOME/bin/setenv.sh" fi
it's working on local machine but not in server machine.
回答1:
I don't exactly what you are trying to do with this piece of code, but basically you just have to create the setenv.sh file in the bin directory of your tomcat install, and it will be used automatically, as per this code piece from catalina.sh :
# Ensure that any user defined CLASSPATH variables are not used on startup,
# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
. "$CATALINA_BASE/bin/setenv.sh"
elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
. "$CATALINA_HOME/bin/setenv.sh"
fi
And for the nice part you don't even need to make it executable. ;-)
Otherwise could you provide a bit more details, like the path where your tomcat is installed and the place where your setenv.sh is installed, please ? See you.
来源:https://stackoverflow.com/questions/18697584/setenv-sh-is-not-working