下面是一些关于Tomcat Server.xml 详细说明,原文文档为英文,下面翻译为中文了.
1 Server1.1 In the Tomcat world, a Server represents the whole container. Tomcat provides a default implementation of the Server interface., and this is rarely customized by users.
1.2 在tomcat的世界里,一个server代表整个容器.Tomcat提供了一个默认的org.apache.catalina接口的实现.用户很少修改这个默认的实现
2 Service2.1 A Service is an intermediate component which lives inside a Server and ties one or more Connectors to exactly one Engine. The Service element is rarely customized by users, as the default implementation is simple and sufficient: Service interface.
2.2 一个Service是一个中间件,存在在一个Server的内部,将一个或者多个Connectors绑定到一个特定的Engine上.默认的实现已经足够用了.是org.apache.catalina.Service接口的一个实现.
A “Service” is a collection of one or more “Connectors” that share a single “Container”
一个Service是一个或者多个Connectors的集合,这些个Connectors共享一个容器。
3 Engine3.1 An Engine represents request processing pipeline for a specific Service. As a Service may have multiple Connectors, the Engine received and processes all requests from these connectors, handing the response back to the appropriate connector for transmission to the client. The Engine interface may be implemented to supply custom Engines, though this is uncommon.
3.2 一个Engine代表一个特定的Service的请求处理的管道.因为一个Service可以有多个Connectors,Engine接收并且处理从这些Connectors过来的所有的请求.并且将结果送回合适的connector并发送给客户端.
3.3 可以实现org.apache.catalina.Interface Engine接口来提供定制的Engines,虽然一般不需要这样做.
3.4 Note that the Engine may be used for Tomcat server clustering via the jvmRoute parameter. Read the Clustering documentation for more information.
4 Host4.1 A Host is an association of a network name, e.g. , to the Tomcat server. An Engine may contain multiple hosts, and the Host element also supports network aliases such as yourcompany.com and abc.yourcompany.com. Users rarely create custom Hosts because the StandardHost implementation provides significant additional functionality.
4.2 一个Host将一个域名和tomcat联系起来.一个Engine可以包含多个hosts,并且一个Host还支持网络别名(例如yourcompany.com 或者 abc.yourcompany.com).用户很少去实现一个org.apache.catalina.Interface Host接口,因为org.apache.catalina.core.StandardHost这个默认的实现已经提供了丰富的扩展功能了
5 Connector5.1 A Connector handles communications with the client. There are multiple connectors available with Tomcat, all of which implement the Connector interface. These include the Coyote connector which is used for most HTTP traffic, especially when running Tomcat as a standalone server, and the JK2 connector which implements the AJP procotol used when connecting Tomcat to an Apache HTTPD server. Creating a customized connector is a significant effort.
5.2 一个Connector处理和客户端的通信.tomcat有多个connectors.这些个connectors都实现了Connector接口.
5.3 创建一个定制的connector是非常复杂的.
5.4 AJP是为Tomcat与HTTP服务器之间通信而定制的协议,能提供较高的通信速度和效率。在配置Tomcat与HTTP服务器集成中,读者可以不必关心AJP协议的细节。关于AJP的知识也可以参考网址:
5.5 Tomcat最主要的功能是提供Servlet/JSP容器,尽管它也可以作为独立的Java Web服务器,它在对静态资源(如HTML文件或图像文件)的处理速度,以及提供的Web服务器管理功能方面都不如其他专业的HTTP服务器,如IIS和Apache服务器。
5.6 因此在实际应用中,常常把Tomcat与其他HTTP服务器集成。对于不支持Servlet/JSP的HTTP服务器,可以通过Tomcat服务器来运行Servlet/JSP组件。
5.7 当Tomcat与其他HTTP服务器集成时,Tomcat服务器的工作模式通常为进程外的Servlet容器,Tomcat服务器与其他HTTP服务器之间通过专门的插件来通信。