element It represents the entire container, which is the top layer element of the Tomcat instance. It is defined by the org.apache.catalina.server interface. It contains a element. And it cannot be a child element of any element.
1> ClassName Specifies the class that implements the org.apache.catalina.server interface. The default value is org.apache.catalina.core.standardServer2> port specifies the Tomcat monitoring shutdown command port. Terminate the server, you must be on the machine where the Tomcat server is located Seutdown Command. This property is required .3> Shutdown Specifies the string of the Shutdown listening port of the Tomcat server when terminating the Tomcat server is running. This property must be set.
element This element is defined by the org.apache.catalina.Service interface, which contains a element, and one or more , these connector elements share the same engine element The first process all the web client requests received directly by the Tomcat server. The second process all WEB customer requests forwarded by the APAHCE server
1> ClassName Specifies the class that implements the org.apahce.catalina.Service interface. The default is org.apahce.catalina.core.standardService2> name Definition Service Name
Element Each service element can only have an Engine element. Elements processes all the client requests received by all elements in the same . Definition by org.apahce.catalina.Engine interface.
1> ClassName Specifies the class that implements the engine interface, the default value is StandardEngine2> DefaultHost Specifies the default host name of the handler, and this host must be defined in the child element in , this host 3> Name Definition ENGINE name
In , the following elements can include , , ,
elements are defined by the Host interface. A engine element can contain multiple elements. Elements per define a virtual host. It contains one or more web applications.
> TRUE ">
1> ClassName Specifies the class that implements the Host interface. The default value is STANDARDHOST2> AppBase Specifies the directory of the virtual host, you can specify an absolute directory or specify a relative directory relative to . If there is no such, the default is / WebAPPS3> AutodePloy If this item is set to true, when the Tomcat service is running, the file under AppBase can be monitored. If there is a new web application join, it will be shipped to the WEB Application 4> UnpackWars If this setting is TRUE , Indicating that the WAR file that applies the web application will be started to run before the open directory structure. If set to false, the direct behavior WAR file 5> Alias Specify the host alias, you can specify multiple individual names 6> DeployonStartup If this is set to true, Indicates that all web applications in the AppBase directory are automatically published when the Tomcat server starts. If the server.xml in the web application does not have the corresponding element, the name of the Tomcat default Context7> Name defines the name of the virtual host in element. It can include the following elements , , ,
element is defined by the Context interface. It is the most frequent element. Each can contain multiple elements. Each web Applying a unique CONTEXT representative web app itself. Servlet container creates a servletContext object for the first web app.
1> ClassName Specifies the class of Context, the default is the STANDARDCONTEXT class 2> Path specifies the URL entry to access the web application, pay attention to / myweb, not myWeb, 3> Reloadable If this property is set to true, the Tomcat server will run in operation Monitor the transfer of the web-inf / class and web-inf / lib directory Class file. If the monitor is updated, the server is reloaded Web Application 3> cookies Specifies whether to support Session through cookies, the default is true4 > useenaming Specifies whether JNDI is supported, the default value is for True
In the element, you can include the following elements , , ,
The Connector element is defined by the Connector interface. Element represents an actual interaction with the client program, which is responsible for receiving the customer request and returns the response to the customer.
The first Connector element defines an HTTP Connector, which receives HTTP requests via the 8080 port; The second Connector element defines a JD Connector, which receives a request for the forward 8009 port. Connector Element Shared Properties 1> ClassName Specifies the class 2> Enablelookups that implements the Connector interface, if set to true, indicate the support domain name resolution, You can call the IP address to host name. The request.getRemoteHost method returns the client name. The default value is true3> redirectport specifies forwarding port. If the current port only supports the Non-SSL request, the field life needs to be securely communicated The client request forwarding the customer request to the attribute of the SSL's RedirectPort port HTTPConnector element 1> ClassName implements the CONNECTOR class 2> Port Set the TCP / IP port, the default value is 8080, if the 8080 is changed to 80, as long as you enter http: / / localhost, because the default port of TCP / IP is 803> Address If the server has more than two IP addresses, this property can set the port listening IP address. By default, port listens to all IP addresses on the server 4> Buffersize sets the cache size of the input stream created by the port. The default value is 2048byte5> protocol Set the HTTP protocol, the default value is http / 1.16> maxthreads to the maximum number of threads that listens to the port, this value also determines the server can be At the same time, respond to the maximum number of customer requests. The default value is 2007> AcceptCount sets the maximum number of client requests for the listening port queue, the default is 10. If the queue is full, the customer must wait .8> ConnectionTimeout defines the establishment of a customer connection timeout If -1, indicating that the attribute of the time JKConnector that does not limit the establishment of a customer connection 1> ClassName implements the CONNECTOR class 2> Port setting AJP port number 3> Protocol must be set to AJP / 1.3