Tomcat element Classification

Source: Internet
Author: User
Tags server port tomcat server

Classification and interpretation of common elements

<Server> elements
It represents the entire container and is the top-level element of the Tomcat instance. defined by the Org.apache.catalina.Server interface. It contains a <Service> element. And it cannot be a child element of any element.

<server port= "8005" shutdown= "shutdown" debug= "0" >

1&GT;CLASSNAME specifies the class that implements the Org.apache.catalina.Server interface. The default value is Org.apache.catalina.core.StandardServer
2>port specifies that Tomcat listens on the shutdown command port. When the server is terminated, the shutdown command must be issued on the machine on which the Tomcat server resides. This property is required.
3&GT;SHUTDOWN specifies a string that sends a shutdown listening port to the Tomcat server when the Tomcat server runs. This property must be set



<Service> elements
The element is defined by the Org.apache.catalina.Service interface, which contains a <Engine> element, and one or more <connector&gt, and these Connector elements share the same Engine element

<service name= "Catalina" >
<service name= "Apache" >
The first <Service> handles all Web client requests that are received directly from the Tomcat server.
The second <Service> handles all Web client requests forwarded by the APAHCE server

1&GT;CLASSNAME specifies the class that implements the Org.apahce.catalina.Service interface. Default is Org.apahce.catalina.core.StandardService
2>name defines the name of the service



<Engine> elements
Each Service element can have only one engine element. The element handles customer requests received by all <Connector> elements in the same <Service>. defined by the Org.apahce.catalina.Engine interface .

<engine name= "Catalina" defaulthost= "localhost" debug= "0" >

1&GT;CLASSNAME specifies the class that implements the engine interface, and the default value is Standardengine
2&GT;DEFAULTHOST Specifies that the client's default hostname is processed, and this host must be defined in <Host> child elements in <Engine>
3>name defines engine's name

In <Engine> can include the following elements <logger>, <realm>, <value>, <Host>



<Host> elements
It is defined by the Host interface. A engine element can contain multiple <Host> elements. Each <Host> element defines a virtual host. It contains one or more Web applications.


1&GT;CLASSNAME specifies the class that implements the host interface. The default value is Standardhost
2&GT;APPBASE Specifies the directory of the virtual host, either by specifying an absolute directory or by specifying a relative directory relative to <CATALINA_HOME>. If this is not the case, the default is <catalina_home>/webapps
3>autodeploy If this is set to true, indicating that the Tomcat service is running, it is able to monitor files under AppBase, and if a new Web application joins in, it will publish the Web application itself.
4>unpackwars If this is set to True, the Web application's war file is expanded to an open directory structure before it is run. If set to False, it will run directly as a war file
5>alias Specify a host alias, you can specify multiple aliases
6>deployonstartup If this key is set to True, all Web applications under the AppBase directory are automatically published when the Tomcat server is started. If the server.xml in the Web application does not have a corresponding <Context> element , the Tomcat default context is adopted
7>name defines the name of the virtual host

You can include the following child elements in the <Host> element
<logger>, <realm>, <value> <Context>


<Context> elements
It is defined by the context interface. Is the most frequently used element. Each <context element represents a single Web application running on a virtual host. A <Host> can contain multiple <Context> elements. Each Web application has a unique
A corresponding context represents the Web application itself. The servlet container creates one for the first Web application
ServletContext object.

<context path= "/sample" docbase= "sample" debug= "0" reloadbale= "true" >

1&GT;CLASSNAME specifies the class that implements the context, which defaults to the Standardcontext class
2>path specify access to Web application URL entry, pay attention to/myweb, not myweb.
3>reloadable If this property is set to True, the Tomcat server will monitor the conversion of the web-inf/classes and Web-inf/lib directory class files in run state. If a class file is monitored to be updated, Server self-Reload Web application
3&GT;COOKIES Specifies whether to support session via cookies, the default value is True
4>usenaming Specifies whether Jndi is supported, and the default value is True


You can include the following elements in the <Context> element
<logger>, <realm>, <resource> <ResourceParams>



Connector element
The .<connector> element, defined by the Connector interface, represents the given component that interacts with the client program to receive customer requests and return response results to the customer.

<connector port= "8080" maxthread= "minsparethreads=" maxsparethread= "", "enablelookups=" and "false" RedirectPort = "8443" acceptcount= "debug=" 0 "connectiontimeout=" 20000 "disableuploadtimeout=" true "/>

<connection port= "8009" enablelookups= "false" redirectport= "8443" debug= "0" protocol= "ajp/1.3"/>
The first Connector element defines an HTTP Connector that receives HTTP requests via port 8080, and the second Connector element defines a JD Connector that receives requests forwarded by other servers over 8009 ports.

Connector element Shared Properties
1&GT;CLASSNAME specifies the class that implements the connector interface
2>enablelookups if set to true to support domain name resolution, IP addresses can be resolved to host names. The Request.getremotehost method called in the Web application returns the client host name. The default value is True
3&GT;REDIRECTPORT specifies the opening port. If the front-end port supports only NON-SSL requests, the client request will be forwarded to the SSL Redirectport port in the event that a secure communication is required
Attributes of the HttpConnector element
1>classname implements the connector class
2>port set TCP/IP port, the default value is 8080, if you change 8080 to 80, you can only enter http://localhost
Because the default port for TCP/IP is 80
3>address If the server has more than two IP addresses, this property can set the IP address that the port listens on. By default, the 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 2048byte
5>protocol set HTTP protocol, default value is http/1.1
6>maxthreads the maximum number of threads that are set on the listening port, this value also determines the maximum number of simultaneous client requests that the server can respond to. Default value is 200
7>acceptcount set the maximum number of client requests on the listening port queue, the default value is 10. If the queue is full, the customer must wait.
8>connectiontimeout defines when a client connection timeout is established. If-1, indicates no limit on when the client connection was established
Properties of Jkconnector
1>classname implements the connector class
2>port Set AJP port number
3>protocol must be set to ajp/1.3

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.