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列表中告知咱們。