For administrators and web developers alike, there are some important bits of information you should familiarize yourself with before starting out. This document serves as a brief introduction to some of the concepts and terminology behind the Tomcat container. As well, where to go when you need help.html
对于管理员和Web开发人员来讲,在开始以前,您应该熟悉一些重要的信息。本文档简要介绍了Tomcat容器背后的一些概念和术语。一样的,当你须要帮助时告诉你去哪里找答案。web
In the course of reading these documents, you will run across a number of terms; some specific to Tomcat, and others defined by the Servlet and JSP specifications.shell
在阅读这些文件的过程当中,您将遇到许多术语; 一些特定于Tomcat的,以及其余由Servlet和JSP规范定义的 。apache
That is it. If you find any more terms we need to add to this section, please do let us know.tomcat
上述这些,若是您发现咱们须要在此部分添加更多字词,请告知咱们。网络
These are some of the key tomcat directories:app
这些是一些关键的tomcat目录:webapp
*.bat
files (for Windows systems). Since the Win32 command-line lacks certain functionality, there are some additional files in here.*.bat
文件的功能重复(对于 Windows 系统)。因为Win32命令行缺乏某些功能,所以这里有一些额外的文件。Throughout the documentation, there are references to the two following properties:jsp
在整个文档中,引用了如下两个属性:ide
CATALINA_HOME: Represents the root of your Tomcat installation, for example /home/tomcat/apache-tomcat-9.0.10 or C:\Program Files\apache-tomcat-9.0.10.
CATALINA_HOME:表示 Tomcat 安装的根目录,例如/home/tomcat/apache-tomcat-9.0.10 或C:\Program Files\apache-tomcat-9.0.10。
CATALINA_BASE: Represents the root of a runtime configuration of a specific Tomcat instance. If you want to have multiple Tomcat instances on one machine, use the CATALINA_BASE property.
If you set the properties to different locations, the CATALINA_HOME location contains static sources, such as .jar files, or binary files. The CATALINA_BASE location contains configuration files, log files, deployed applications, and other runtime requirements.
若是将属性设置为其余位置,则 CATALINA_HOME 位置包含静态源,例如.jar 文件或二进制文件。CATALINA_BASE 位置包含配置文件,日志文件,已部署的应用程序和其余运行时要求。
By default, CATALINA_HOME and CATALINA_BASE point to the same directory. Set CATALINA_BASE manually when you require running multiple Tomcat instances on one machine. Doing so provides the following benefits:
默认状况下,CATALINA_HOME 和 CATALINA_BASE 指向同一目录。当您须要在一台计算机上运行多个 Tomcat 实例时,请手动设置 CATALINA_BASE。这样作有如下好处:
Before you start using CATALINA_BASE, first consider and create the directory tree used by CATALINA_BASE. Note that if you do not create all the recommended directories, Tomcat creates the directories automatically. If it fails to create the necessary directory, for example due to permission issues, Tomcat will either fail to start, or may not function correctly.
在开始使用 CATALINA_BASE 以前,首先考虑并建立 CATALINA_BASE 使用的目录树。请注意,若是您不建立全部推荐的目录,Tomcat 会自动建立目录。若是没法建立必须的目录,例如因为权限问题,Tomcat 将没法启动,或者可能没法正常运行。
Consider the following list of directories:
请考虑如下目录列表:
The bin directory with the setenv.sh, setenv.bat, and tomcat-juli.jar files.
Recommended: No.
Order of lookup: CATALINA_BASE is checked first; fallback is provided to CATALINA_HOME.
在 bin 与目录 setenv.sh, setenv.bat, 和 tomcat-juli.jar 文件。 推荐:不。 查找顺序:首先检查 CATALINA_BASE; 回退提供给 CATALINA_HOME。
The lib directory with further resources to be added on classpath.
Recommended: Yes, if your application depends on external libraries.
Order of lookup: CATALINA_BASE is checked first; CATALINA_HOME is loaded second.
lib 具备要在类路径上添加的更多资源的目录。 推荐:是的,若是您的应用程序依赖于外部库。 查找顺序:首先检查 CATALINA_BASE; CATALINA_HOME 第二次加载。
The logs directory for instance-specific log files.
Recommended: Yes.
该logs目录实例特定的日志文件。 推荐:是的。
The webapps directory for automatically loaded web applications.
Recommended: Yes, if you want to deploy applications.
Order of lookup: CATALINA_BASE only.
webapps 自动加载的Web应用程序 的目录。 推荐:是的,若是要部署应用程序。 查找顺序:仅限 CATALINA_BASE。
The work directory that contains temporary working directories for the deployed web applications.
Recommended: Yes.
work 目录包含用于部署的Web应用程序的临时工做目录目录。 推荐:是的。
The temp directory used by the JVM for temporary files.
Recommended: Yes.
temp 目录被JVM用来存放临时文件。 推荐:是的。
We recommend you not to change the tomcat-juli.jar file. However, in case you require your own logging implementation, you can replace the tomcat-juli.jar file in a CATALINA_BASE location for the specific Tomcat instance.
咱们建议您不要更改tomcat-juli.jar文件。可是,若是您须要本身的日志记录实现,则能够替换tomcat-juli.jar特定Tomcat实例的 CATALINA_BASE 位置中的文件。
We also recommend you copy all configuration files from the CATALINA_HOME/conf directory into the CATALINA_BASE/conf/ directory. In case a configuration file is missing in CATALINA_BASE, there is no fallback to CATALINA_HOME. Consequently, this may cause failure.
At minimum, CATALINA_BASE must contain:
咱们还建议您将 CATALINA_HOME/conf 目录中的全部配置文件复制 到 CATALINA_BASE/conf/目录中。若是CATALINA_BASE中缺乏配置文件,则不会回退到 CATALINA_HOME。所以,这可能会致使失败。
至少,CATALINA_BASE必须包含:
That includes the conf directory. Otherwise, Tomcat fails to start, or fails to function properly.
For advanced configuration information, see the RUNNING.txt file.
那包括conf目录。不然,Tomcat没法启动或没法正常运行。
有关高级配置信息,请参阅 RUNNING.txt 文件。
The CATALINA_BASE property is an environment variable. You can set it before you execute the Tomcat start script, for example:
CATALINA_BASE属性是一个环境变量。您能够在执行Tomcat启动脚本以前进行设置,例如:
This section will acquaint you with the basic information used during the configuration of the container.
All of the information in the configuration files is read at startup, meaning that any change to the files necessitates a restart of the container.
本节将使您了解容器配置期间使用的基本信息。
配置文件中的全部信息都在启动时读取,这意味着对文件的任何更改都须要从新启动容器。
While we've done our best to ensure that these documents are clearly written and easy to understand, we may have missed something. Provided below are various web sites and mailing lists in case you get stuck.
虽然咱们已尽最大努力确保这些文件清晰易读,但咱们可能错过了一些内容。下面提供了各类网站和邮件列表,以防您遇到困难。
Keep in mind that some of the issues and solutions vary between the major versions of Tomcat. As you search around the web, there will be some documentation that is not relevant to Tomcat 9, but only to earlier versions.
请记住,Tomcat的主要版本之间的一些问题和解决方案各不相同。当您在网上搜索时,会有一些与Tomcat 9无关的文档,但仅限于早期版本。
And, if you think something should be in the docs, by all means let us know on the TOMCAT-DEV list.
而且,若是您认为某些内容应该在文档中,请务必在TOMCAT-DEV列表中告知咱们。