Tomcat server. xml

Source: Internet
Author: User

For the Chinese version, refer to the blog address:

Http://www.blogjava.net/baoyaer/articles/107278.html

 

The following is a detailed description of Tomcat server. xml. The original document is in English and the following is translated into Chinese.

1 Server

1.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 In the Tomcat worldServerRepresentativeEntire container. Tomcat provides a defaultOrg. Apache. Catalina InterfaceThe default implementation is rarely modified.

2 Service

2.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.2ServiceIsMiddleware, Exists in a server,Bind one or more ors ORS to a specific engine.. The default implementation is enough. YesOrg. Apache. Catalina. ServiceAn Implementation of the interface.

A "service" is a collection of one or more "connectors" that share a single "Container"

OneServiceIs one orMultipleConnectors. These ors share a container.

3 engine

3.1 An engine represents request processing pipeline for a specific service. as a service may have multiple connectors, the engine was Ed 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 not uncommon.

3.2EngineRepresentativeThe pipeline for processing requests of a specific service.Because a service can have multiple ors,The engine receives and processes all requests from these ors, and sends the results back to the appropriate connector and sends them to the client..

3.3Org. Apache. Catalina. Interface Engine InterfaceTo provide customized engines, although this is generally not required.

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 host

4.1 A host is an association of a network name, e.g. www.yourcompany.com, to the Tomcat server. an engine may contain in 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.2HostSetOne domain name and tomcatContact. an engine can contain multiple hosts, and a host also supports Network aliases (such as yourcompany.com or abc.yourcompany.com ). users seldom implement an org. apache. catalina. interface host interface, becauseOrg. Apache. Catalina. Core. standardhostThis default implementation provides a wide range of extension functions.

5 Connector

5.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.2Ctor processes communications with clients. Tomcat has multiple ors. These ors all implement the connector interface.

5.3 creating a custom ctor Ctor is very complicated.

5.4AJPYesCustomized protocol for communication between Tomcat and HTTP Server,High communication speed and efficiency. In the integration of Tomcat and HTTP server configuration, you do not have to worry about the details of the AJP protocol. For more information about AJP, see the following link:

5.5TomcatThe main function isServlet/jsp containersAlthough it can also be used as an independent Java Web server,It does not process static resources (such as HTML files or image files) as well as provides Web server management functions as well as other professional HTTP servers, such as IIS and Apache servers.

5.6 in practical applications, Tomcat is often integrated with other HTTP servers. For HTTP servers that do not support Servlet/JSP, you can use the Tomcat server to run Servlet/jsp components.

5.7 When Tomcat is integrated with other HTTP servers, the working mode of the Tomcat server is usually the servlet container outside the process, and the Tomcat server communicates with other HTTP servers through specialized plug-ins.

5.8 principle of Tomcat and HTTP server integration: the Tomcat server establishes a connection with the client program through the connector component. The connector component is responsible for receiving client requests and sending the response results of the Tomcat server to the client. By default, Tomcat configures two connectors in server. xml:

L <connector Port = "8080" protocol = "HTTP/1.1" connectiontimeout = "20000" redirectport = "8443"/>

L <connector Port = "8009" protocol = "AJP/1.3" redirectport = "8443"/>

5.9 The first connector listens to port 8080 and establishes an HTTP connection. This connector is used to access the Web application of the Tomcat server through a browser.

5.10 The second connector listens to port 8009 and is responsible for establishing connections with other HTTP servers. This connector is used when Tomcat is integrated with other HTTP servers.

5.11 Tomcat provides dedicatedJK plug-inTo communicate with the HTTP server. ShouldPlace the JK plug-in on the HTTP server of the other party.

5.12 Tomcat provides different JK plug-ins for different HTTP servers.

L integration with Apache HTTP Server in Windows:Mod_jk_2.0.46.dll

L integration with Apache HTTP Server in Linux (redhet:Mod_jk.so-ap2.0.46-rh72. 46-rh72

L integration with the IIS server:Isapi_redirect.dll

5.13 AJP is a custom protocol for communication between Tomcat and HTTP servers, providing high communication speed and efficiency.

5.14 for more information about AJP, refer to the following link:

Http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/doc/common/AJPv13.html

5.15 if both Tomcat servers run on the same machine, modify at least three port numbers of one Tomcat server.

6 Context

6.1 A context represents a web application. A host may contain in multiple contexts, each with a unique path. the context interface may be implemented to create custom contexts, but this is rarely the case because the standardcontext provides significant additional functionality.

6.2ContextRepresentsWeb Applications.One host can contain multiple contexts. Each has a different access address.

6.3 you can implement the context interface to create your own contexts. But it is rarely used becauseStandardcontextMultiple additional functions are provided.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.