setenv.sh is not working

為{幸葍}努か 提交于 2019-12-13 05:06:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!