[英]Tomcat and CATALINA_HOME
I am messing with Tomcat server and I think some strange thing happened. 我正在搞乱Tomcat服务器,我觉得有些奇怪的事情发生了。 I downloaded Tomcat 7 from apache website (not an RPM but tar.gz).
我从apache网站下载了Tomcat 7(不是RPM而是tar.gz)。 As I understand there should be CATALINA_HOME and CATALINA_BASE environment variables set, but when I do export on my terminal I can't see any of them, but server starts fine through bin/startup.sh and it even says
据我所知,应该设置CATALINA_HOME和CATALINA_BASE环境变量,但是当我在终端上导出时我看不到它们中的任何一个,但服务器通过bin / startup.sh启动正常,它甚至说
Using CATALINA_BASE: /home/andrzej/apache-tomcat-7.0.25
Using CATALINA_HOME: /home/andrzej/apache-tomcat-7.0.25
Using CATALINA_TMPDIR: /home/andrzej/apache-tomcat-7.0.25/temp
Using JRE_HOME: /usr/lib/jvm/jre
Using CLASSPATH: /home/andrzej/apache-tomcat-7.0.25/bin/bootstrap.jar:/home/andrzej /apache-tomcat-7.0.25/bin/tomcat-juli.jar
I think that the other day variables were set, but now I tried to use them with keytool to generate certificate and I noticed they are not there. 我认为其他日期变量已设置,但现在我尝试使用它们与keytool生成证书,我发现它们不在那里。 Am I missing something, because even if I can't see them everything works fine (startup/shutdown and eclipse with tomcat)?
我错过了什么,因为即使我看不到它们一切正常(启动/关闭和使用tomcat eclipse)?
Those environment variables are optional. 这些环境变量是可选的。 If there are none set on the system, Tomcat will just set some defaults based on the location of the currently running script (the
startup.sh
and so on), which will be used as long as Tomcat is running. 如果系统上没有设置,Tomcat将根据当前运行的脚本(
startup.sh
等)的位置设置一些默认值,只要Tomcat正在运行,它就会被使用。 If you know Shell script language, just open catalina.sh
file in an editor and read it. 如果您了解Shell脚本语言,只需在编辑器中打开
catalina.sh
文件并阅读即可。
If you take a look into catalina.sh
(which is called from startup.sh
) you will notice that in case CATALINA_HOME is not set it automatically sets it to one level above of the program executable: 如果你看一下
catalina.sh
(从startup.sh
调用),你会注意到如果没有设置CATALINA_HOME,它会自动将它设置为程序可执行文件的一个级别:
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
and CATALINA_BASE, if absent, is set equal to CATALINA_HOME: 和CATALINA_BASE,如果不存在,则设置为等于CATALINA_HOME:
if [ -z "$CATALINA_BASE" ] ; then
CATALINA_BASE="$CATALINA_HOME"
fi
So there's no real requirement for the variables to be set. 因此,没有真正要求设置变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.