tomcat6 - Tomcat究竟是如何耗尽CATALINA_HOME和CATALINA_BASE的

标签 tomcat6 tomcat

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

temp、日志、webapps、bin 和工作我理解起来没有任何困难。

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

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

CATALINA_BASE/lib 也是如此……这可以作为“全局”lib 文件夹吗?实例?

最佳答案

您可以在 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/

相关文章:

java - 如何定义 Java Tomcat 应用程序的正确启动顺序?

caching - 如何在Dart中缓存半身像

java - Solr 核心 URL/Typo3

java - Tomcat 应用程序生成太多日志

configuration - Tomcat 6.x 管理

tomcat - Spring MVC 无法获取在 JNDI 中配置的数据源

eclipse - Tomcat 从 Eclipse 和 startup.sh 启动

java - Tomcat 8 启动多次 [LifecycleException]

java - 无法部署 Tomcat6 webapp

tomcat - 如何为 openshift tomcat 制作 servlet?