gpt4 book ai didi

tomcat6 - Tomcat到底是怎么跑完CATALINA_HOME和CATALINA_BASE的

转载 作者:行者123 更新时间:2023-11-28 21:56:02 25 4
gpt4 key购买 nike

我找不到与此相关的文档。经过一些谷歌搜索后,我发现 bin、conf、logs、temp、webapps、work 是应该存在于 CATALINA_BASE 中的目录。

temp、logs、webapps、bin 和 work 我在理解上没有任何困难。

bin 我想只是另一个 bin 文件夹,如果由于某种原因 CATALINA_HOMECATALINA_BASE 都在 PATH 中,那么两个文件夹中的脚本都可以执行。

但是 conf 呢?如果设置了CATALINA_BASECATALINA_HOME/conf的内容会被完全忽略吗?假设我只需要自定义几个配置文件 pr。 CATALINA_BASE,我是否仍需要在 CATALINA_BASE/conf 中保留一套完整的配置文件,或者是否可以在 CATALINA_HOME/conf 中保留标准配置文件共享?

对于 CATALINA_BASE/lib 也是如此……这会作为“全局”lib 文件夹 pr 工作吗?实例?

最佳答案

您可以在 Tomcat 文档中找到答案:

http://tomcat.apache.org/tomcat-6.0-doc/RUNNING.txt

Advanced Configuration - Multiple Tomcat Instances

In many circumstances, it is desirable to have a single copy of a Tomcat binary distribution shared among multiple users on the same server. To make this possible, you can set the $CATALINA_BASE environment variable to the directory that contains the files for your 'personal' Tomcat instance.

When you use $CATALINA_BASE, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME:

  • bin - Only setenv.sh (*nix), setenv.bat (windows) and tomcat-juli.jar

  • conf - Server configuration files (including server.xml)

  • logs - Log and output files

  • webapps - Automatically loaded web applications

  • work - Temporary working directories for web applications

  • temp - Directory used by the JVM for temporary files (java.io.tmpdir)

Note that by default Tomcat will first try to load classes and JARs from $CATALINA_BASE/lib and then $CATALINA_HOME/lib. You can place instance specific JARs and classes (e.g. JDBC drivers) in $CATALINA_BASE/lib whilst keeping the standard Tomcat JARs in $CATALINA_HOME/lib.

If you do not set $CATALINA_BASE, $CATALINA_BASE will default to the same value as $CATALINA_HOME, which means that the same directory is used for all relative path resolutions.

关于tomcat6 - Tomcat到底是怎么跑完CATALINA_HOME和CATALINA_BASE的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4725190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com