Tomcat configuration file Server.xml detailed

Source: Internet
Author: User
Tags response code server port tomcat server

element name

Property

explain

Server

Port

Specifies a port that listens for the request to shut down Tomcat

Shutdown

Specifies the command string to send to the port

Service

Name

Specify the name of the service

Connector (indicates the connection between client and service)

Port

Specifies the port number to be created on the server side and listens for requests from the client on this fracture surface

Minprocessors

Number of threads created at server startup to process requests

Maxprocessors

Maximum number of threads that can be created for processing requests

Enablelookups

If true, a DNS query can be made by calling Request.getremotehost () to obtain the actual hostname of the remote client and, if False, not a DNS query, but rather a return of its IP address

Redirectport

Specifies a port number that is redirected after an SSL transfer request is received by the server while processing an HTTP request

Acceptcount

Specifies the number of requests that can be placed in the processing queue when all available processing requests are used, and requests that exceed this number will not be processed

ConnectionTimeout

Specify the number of times to timeout (in milliseconds)

Engine (represents a request processor in a specified service, receiving and processing requests from connector)

Defaulthost

Specifies the host name of the default processing request, which is at least the same as the Name property value of one of the host elements

Context (representing a Web application, usually a war file, and specific information about war see servlet specification)

DocBase

Path to the application or the path that the war file holds

Path

A prefix representing the URL of this Web application, so that the requested URL is http://localhost:8080/path/* * *

Reloadable

This property is very important, and if true, Tomcat automatically detects changes to the/web-inf/lib and/web-inf/classes directories of the application, automatically loads new applications, and we can change the application without having to restart Tomcat

Host (represents a virtual host)

Name

Specify host Name

AppBase

Application base directory, which is the directory where the application is stored

Unpackwars

If true, Tomcat automatically extracts the war file, otherwise does not understand the pressure, and runs the application directly from the war file

Logger (for logging, debugging, and error messages)

ClassName

Specifies the class name used by Logger, which must implement the Org.apache.catalina.Logger interface

Prefix

Specifies the prefix of the log file

Suffix

Specify the suffix of log file

Timestamp

If true, time is added to the log file name, as in the following example: Localhost_log.2001-10-04.txt

Realm (a database that holds user names, passwords, and role)

ClassName

Specifies the class name used by Realm, which must implement the Org.apache.catalina.Realm interface

Valve (features similar to logger, whose prefix and suffix properties are interpreted in the same way as in logger)

ClassName

Specifies the class name used by valve, such as the use of the Org.apache.catalina.valves.AccessLogValve class to record access information for the application

Directory

Specify where log files are stored

Pattern

There are two values, common the remote host name or IP address, username, date, the first line of the requested string, the HTTP response code, the number of bytes sent. Combined is more than the common way to record

<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>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.
< Host name = "localhost" debug = "0" appbase = "WebApps" Unpackwars = "true" Autodeploy = "true" > 1>classname specifies implementation hos The class of the T interface. 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>
Related Article

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.