简体   繁体   English

Tomcat和CATALINA_HOME

[英]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.

相关问题 Tomcat - CATALINA_BASE 和 CATALINA_HOME 变量 - Tomcat - CATALINA_BASE and CATALINA_HOME variables 是否需要在用户中为tomcat设置CATALINA_HOME变量 - Is it necessity to set the CATALINA_HOME variables in user for tomcat tomcat CATALINA_HOME openshift上的环境变量问题 - tomcat CATALINA_HOME environment variable issue on openshift Tomcat:“CATALINA_HOME 环境变量定义不正确” - Tomcat: “The CATALINA_HOME environment variable is not defined correctly” Windows 7上Apache Tomcat 8的%CATALINA_HOME%环境变量 - %CATALINA_HOME% environment variable for Apache Tomcat 8 on Windows 7 tomcat没有选择context.xml,尽管它已被关联到CATALINA_HOME> conf> Catalina> localhost - tomcat does not pick the context.xml, it is getting coopied to CATALINA_HOME> conf>Catalina>localhost though Tomcat7 Ubuntu 14.04将$ CATALINA_HOME指向var / lib / tomcat7 / ROOT - Tomcat7 Ubuntu 14.04 pointing $CATALINA_HOME to var/lib/tomcat7/ROOT 在Ubuntu(使用apt)上安装Tomcat 5.5会使CATALINA_HOME保持不变 - Install of Tomcat 5.5 on Ubuntu (using apt) leaves CATALINA_HOME unset Tomcat从{$ catalina_home} /(应用程序实例)/ lib加载JDBC连接器jar,但如果在项目pom中则不加载 - Tomcat loading JDBC connector jar from {$catalina_home}/(app instance)/lib but not if in project pom 如何在 Windows 7 中设置 CATALINA_HOME 变量? - How to set CATALINA_HOME variable in windows 7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM