Tomcat.xml file detailed explanation

xiaoxiao2021-03-06  36

Parent-child rellationships with each other ->

Which May Contain One or More "Service" Instances. The Server

Listens for a shutdown command on the indeicated port.

Note: a "Server" is not itself a "container", SO you may not

Define Subcomponents Such As "Valves" or "loggers" at this level.

->

"Service" instance. The server listenss the shutdown command on the specified port.

Note: A "server" is not a "container" (container), so you are here

Cannot define such as "Valves" or "Loggers" sub-components

->

INCLUDING YOUR OWN MBEAN-DESCRIPTOR FILE (s), and setting the

"Descriptors" Attribute to Point to A ';' SEPERATED LIST OF PATHS

In the classloader sense) of files to add to the default list.

E.G. Descriptors = "/ COM / myfirm / mypackage / mbean-descriptor.xml"

->

"Descriptors" property is ";" to add it to the default list with ";"

Among them, for example: descriptors = "/ com / myfirm / mypackage / mabean-descriptor.xml".

->

Debug = "0" />

UserdatabaseEnderalm to Authenticate Uses ->

Type = "org.apache.catalina.userdatabase"

Description = "User Database That Can Be Updated and Saved">

factory

org.apache.catalina.users.MemoryUserDatabaseFactory

pathname

conf / tomcat-users.xml

A Single "Container" (and Therefore the Web Applications Visible

WITHIN THAT Container. Normal, That Container is an "engine",

But this is not required.

Note: a "service" is not itself a "container", SO you may not

Define Subcomponents Such As "Valves" or "loggers" at this level.

->

Combination (therefore, the application can be seen in the container). Typically, this container is a "engine" (engine), but this is not necessary.

Note: A "service" itself is not a container, so you are not defined at this level.

Such as "Valves" or "Loggers" subcomponents.

->

And Responses Are Returned. Each Connector Passes Requests on To The

Associated "Container" for processing.

BY Default, A Non-SSL HTTP / 1.1 Connector Is Established on Port 8080.

You can also enable an ssl http / 1.1 connect port 8443 by

FOLLOWING THE INSTRUCTIONS BELOW AND UNCOMMENTING THE Second Connector

Entry. SSL Support Requires The Following Steps (See The Ssl Config

Howto in the tomcat 5 Documentation Bundle for more detailed

安Structions:

* If Your JDK Version 1.3 or Prior, Download and Install JSSE 1.0.2 OR

Later, And Put the Jar Files Into "$ java_home / jre / lib / ext".

* EXECUTE:

% Java_home% / bin / keytool -genkey -alias tomcat -keyalg RSA (Windows)

$ Java_home / bin / keytool -genkey -alias tomcat -keyalg RSA (UNIX)

With a password value of "changeit" for Both the certificate and

The keystore itself.

BY Default, DNS Lookups Are Enabled WHEN A Web Application Calls

Request.getRemotehost (). THIS CAN HAVE AN Adverse Impact ON

Performance, So you can disable it by setting the

"Enablelookups" Attribute to "false". When DNS Lookups Are Disabled,

Request.getRemotehost () Will Return the string version of the

IP Address of The Remote Client.

->

The connector is passed through the related "Container" processing request. By default, a non-SSL HTTP / 1.1 connector is bound to port 8080. You can also pass

Create one on port 8443, according to the following instructions below and cancel the annotation of the second connector entry.

SSL HTTP / 1.1 connector. Open SSL support requires the following steps (see how to see Tomcat 5 documentation

Configure the instructions for SSL to achieve more details):

* If your JDK is 1.3 or 1.3 previous version, download the installation jsse 1.0.2 or later, and put

Set the JAR file to the "$ java_home / jre / lib / ext" directory.

* With a password value of "Changeit":

% Java_home% / bin / keytool -genkey -alias tomcat -keyalg RSA (Windows)

$ Java_home / bin / keytool -genkey -alias tomcat -keyalg RSA (UNIX)

To generate its own certificate private key.

By default, the DNS query is feasible when a web application calls the request. This will make performance

It is some adverse effect, so you can set "EnableLookups" to "false" to close DNS

Inquire. When the DNS query is turned off, Request.getRemotehost () will return to the remote customer IP

Site string.

->

Maxthreads = "150" MINSPARETHREADS = "25" maxsparethreads = "75"

Enablelookups = "false" redirectport = "8443" acceptcount = "100"

Debug = "0" ConnectionTimeout = "20000"

DisableUploadTimeout = "true" />

TO 0 ->

Compression = "on"

CompressionminSize = "2048"

NocompressionUseragents = "Gozilla, Traviata"

CompressableMimeType = "text / html, text / xml"

->

Compression = "on"

CompressionminSize = "2048"

NocompressionUseragents = "Gozilla, Traviata"

CompressableMimeType = "Text / HTML, Text / XML" ->

Maxthreads = "150" MINSPARETHREADS = "25" maxsparethreads = "75"

Enablelookups = "false" disableuploadtimeout = "true"

Acceptcount = "100" debug = "0" scheme = "https" secure = "true"

ClientAuth = "false" sslprotocol = "tls" />

->

Enablelookups = "false" redirectport = "8443" debug = "0"

Protocol = "AJP / 1.3" />

Maxthreads = "150" MINSPARETHREADS = "25" maxsparethreads = "75"

Enablelookups = "false"

AcceptCount = "100" debug = "0" connectionTIMEOUT = "20000"

Proxyport = "80" DisableUploadTimeout = "true" />

->

Every Request. The Engine Implementation for Tomcat Stand Alone

Analyzes the http headers include, and passes the required

On to the appropriate Host (Virtual Host). ->

Or on the virtual host. ->

->

->

The Request Headers and Cookies That Were Received, and The Response

Headers and cookies That Were Sent, For All Requests Received By

This Instance of Tomcat. if you care only about requests to a

Particular Virtual Host, OR a Particular Application, Nest this

Element Inside the Corresponding Or entry INSTEAD.

For A Similar Mechanism That Is Portable To All Servlet 2.4

Containers, Check Out the "RequestDumperfilter" Filter in the

EXAMPLE Application (The Source for this Filter May Be Found in

"$ CATALINA_HOME / WebApps / Examples / Web-INF / CLASSES / FILTERS").

Request dumping is disabled by default. Uncomment the following

ELEMENT TO ENABLE. ->

Received request headers and cookies, as well as debugging information of the response headers and cookies. in case

You only use a specific virtual host or a specific application request, in the corresponding

Or Use this element in the inlet.

For all servlets 2.4, the "RequestDumperfilter" filtering in the sample program is very easy (this filter source code can be

"$ Catalina_home / webApps / examples / web-inf / classes / filters" is found.

Request dump defaults to shut down, if you want to use it, cancel the comment of the following row. ->

->

Prefix = "Catalina_Log." SUFFIX = ". TXT"

TimeStamp = "true" />

Resources Under The Key "UserDatabase". Any Edits

That Are Performed Against this UserDatabase Are IMMEDIATELY

Available for use by the realm. ->

database. By using Realm, any editing for this user database will be available immediately

Debug = "0" resourceEName = "userdatabase" />

Need to go back quickly ->

->

Stored in a Database and Accessed Via JDBC ->

Realm configuration. ->

ConnectionURL = "JDBC: mysql: // localhost / authority"

ConnectionName = "test" connectionpassword = "test"

UserTable = "Users" usernamecol = "user_name" usercredcol = "user_pass"

Userroletable = "user_roles" ROLENAMECOL = "role_name" />

->

Drivername = "Oracle.jdbc.driver.OracleDriver"

CONNECTIONURL = "JDBC: Oracle: Thin: @ntserver: 1521: Orcl

ConnectionName = "Scott" ConnectionPassword = "Tiger"

UserTable = "Users" usernamecol = "user_name" usercredcol = "user_pass"

Userroletable = "user_roles" ROLENAMECOL = "role_name" />

->

Drivername = "sun.jdbc.odbc.jdbcodbcdriver"

ConnectionURL = "JDBC: ODBC: Catalina"

UserTable = "Users" usernamecol = "user_name" usercredcol = "user_pass"

Userroletable = "user_roles" ROLENAMECOL = "role_name" />

->

NOTE: XML Schema Validation Will Not Work with Xerces 2.2.

->

Note: XML mode confirmation will not work with Xerces 2.2.

->

Unpackwars = "true" autodeploy = "true"

Xmlvalidation = "false" xmlnamespaceaware = "false">

By Defining this element, means That Every Manager Will Be Changd.

SO WHEN Running a Cluster, ONLY Make Sure That You have webapps in there

That Need to Be Clustered And Remove The Other ones.

A Cluster Has The Following Parameters:

Define a cluster for this node, which means that each administrator will be changed.

Therefore, when running a cluster, only confirmed that there must be gathering and removing other places with you.

Web software.

A cluster has the following parameters:

ClassName = The full qualified name of the cluster class

ClassName = full-qualified name of this cluster class

Name = a descriptive name for your cluster, can be anything

Name = Description name of your cluster, can be any description

Debug = the debug level, Higher Means More Output

Debug = debug level, higher means more output

McastAddr = The Multicast Address, Has to Be The Same For All The Nodes

McastAddr = multicast address, all nodes must have the same multicast address

Mcastport = The Multicast Port, Has to Be The Same For All The Nodes

MCASTPORT = multicast port, must have the same multicast port for all nodes

Mcastbindaddr = bind The Multicast Socket To a Specific Address

MCASTBINDADDR = Bind multicast set to a specified address

Mcasttl = The Multicast TTL if you want to limit your Broadcast

Mcastttl = multicast life, if you want to limit your broadcast

Mcastsotimeout = The Multicast Readtimeout

McastSotimeout = multicast reading timeout

Mcastfrequency = the number of milliseconds in between send a "i'm alive" Heartbeat

MCASTFREQUENCY = Send "I'm alive" interval number of information

McastDroptime = The number a milliseconds before a node is considered "dead" if no healthbeat is receivated

McastDroptime = How long does not receive "I'm alive", identify this node as dead node (unit: millisecond)

TCPTHREADS TO HANDE INCOTION Replication Requests, Optimal WouldestcpthReadcount = The number of threads used to process repeated introduction requests, preferably each node has the same number of threads

TCPLISTENADDRESS = The Listen Address (Bind Address) for TCP Cluster Request On this Host,

In Case of Multiple Ethernet Cards.

Auto Means That Address Becomes

Inetaddress.getlocalhost (). GetHostAddress ()

TCPListenAddress = listening to the address of the TCP cluster request on the host with multiple Ethernet cards (binding address),

Auto means addresses from inetaddress.getlocalhost (). gethostaddress ().

TCPListenport = TCP Listen Port

TCPListenport = TCP listening port

TCPSELECTORTIMEOUT = Timeout (ms) for the selector.select () Method in case the os

HAS a Wakup bug in java.nio. set to 0 for no timeout

TCPSelectortormTimeout = Use selector.select () timeout in the case of java.nio in the operating system

Mixtale number. Set to 0 without timeout limit

PRINTTSCREEN = True Means That Managers Will Also Print to Std.out

PrintToscreen = true means that the administrator's related information will also be printed to std.out

ExpiresessionsSonshutdown = true means That

ExpiresessionsSonShutdown = TRUE means ?????

Usedirtyflag = True Means That We Only Replicate A Session After SetAttribute, RemoveAttribute Has Been Called.

False Means to Replicate The Session After Each Request.

False Means That Replication Would Work for The Following Piece of Code:

<%

Hashmap map = (havehmap) session.getattribute ("MAP");

Map.Put ("key", "value");

%>

Usedirtyflag = true means we can only copy a session after calling SetAttribute, RemoveAttribute;

False means copying a session after each request.

False means copying the following code to work:

<%

Hashmap map = (havehmap) session.getattribute ("MAP");

Map.Put ("key", "value");

%>

replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'. * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.

* Synchronous Means That The Thread That Executes The Request, IS Also The

Thread the replicates the data to the other nodes, and will not return unsteil all

Nodes Have Received The Information.

* Asynchronous means that there is a specific 'sender' Thread for Each Cluster Node,

So The Request Thread Will Queue The Replication Request Into A "Smart" Queue,

And the return to the client.

The "smart" queue is a queue where gen a session is added to the queue, and the same session

Already exists in the queue from a Previous Request, That Session Will Be Replace

In The Queue Instead of Replicating TWU Requests. This Almost Never Happens, Unless there is

Large network delay.

ReplicationMode = can be "pooled", "synchronous" or "asynchronous"

* Pooled means synchronous replication on multiple sockets. For example, copy the data first and then request it.

This is the same as "Synchronous", except that it uses a socket, so it is multithreaded. it is

The fastest and most advanced settings use this configuration, also adds the domain that handles the copied TCP thread.

* Synchronous refers to the thread that executes the requested, and it is also a thread that copies the data to other nodes, and until

All nodes returned after they received the information.

* Asynchronous, in terms of each cluster node, this is a special "sender" thread,

So the request thread will queue the copy request into a small queue, then return to the user.

This queue is a session to be added to the queue, and from the previous request, the same session has existed

This session will be placed in the queue instead of repeated two requests. This will never occur, unless there is a large network delay.

->

When Configuring For Clustering, you also add in a valve to catch all the requests

COMING IN, AT The End of The Request, The Session May Or May Not Be Replicated.

A session is replicated if and only if all the conditions are Met:

1. USEDIRTYFLAG IS TRUE OR SetAttribute or Removettribute Has Been Called and

2. a session exists (HAS Been Created)

3. The request is not trapped by the "filter" attribute

The Filter Attribute Is To Filter Out Requests That Could Not Modify The Session,

Hence We don't replicate the session after the end of this request.

The Filter Is Negative, IE, Anything You Put in The Filter, You Mean To Filter Out,

IE, No Replication Will Be Done on Requests That Match One of the Filters.

The filter attribute is delimited by;, so you can set; eve if you wanted to.

Filter = ". * /. gif;" Means "Means That We Will NOT Replicate The Session After Requests with the URI

Ending with .gif and .js are intercepted.

->

It may not be copied. Whether a session is replicated depends on whether the following conditions occur:

1. USEDIRTYFLAG is true, or SetAttribute or RemoveAttribute has been called.

2. The session has existed (you have been created).

3. The request is not captured by the "Filter" property.

This Filter property is used to filter those requests that cannot modify the session, so we do not copy after this request.

The host. This filter is negative, for example, you have sent something to the filter, and then filter out, in that match

A copy will not occur on the filter.

The filter attribute is separated by a semicolon, so you can't go back, even if you want to do it.

Filter = ". * /. gif;" means that the session is not copied after the URI request ended with .gif and .js.

Managerclassname = "org.apache.catalina.cluster.Session.Deltamanager" expiresessionsSonShutdown = "false"

Usedirtyflag = "true">

ClassName = "org.apache.catalina.cluster.mcast.mcastservice"

McastAddr = "228.0.0.4"

Mcastport = "45564"

McastFrequency = "500"

McastDroptime = "3000" />

ClassName = "org.apache.catalina.cluster.tcp.ReplicationListener"

TCPListenAddress = "auto"

TCPListenport = "4001"

TCPSELECTORTIMEOUT = "100"

TCPTHREADCOUNT = "6" />

ClassName = "Org.apache.catalina.cluster.tcp.ReplicationTransmitter"

ReplicationMode = "Pooled" />

.... * /. htm;. * /. html;. * /. html;. * /...........................................................................................................................................................................................................................................................................

->

Individally. UNComment The Following Entry if you would like

a user to be authenticated the first time they eNCOUNTER A

Resource protected by a security constraint, and the Have That

User Identity MainTained Across * All * Web Applications Contained

In this Virtual Host. ->

When a certain security constraint is protected, if you want the user to be authenticated for the first time, then,

Cancel the comment from the entrance line below, and then contain this user in this virtual host, across all

User identification of web applications. ->

Debug = "0" />

->

DEFAULT, LOG Files Are Created in The "log" Directory Relative to $ Catalina_Home. if you wish, you can specify a differentrent

Directory with the "Directory" Attribute. Specify Either A Relative

(To $ catalina_home) or absolute path to the desired Directory.

->

Under the logs directory under the $ catalina_home directory. With the Directory property, you can also specify one

Different catalogs if you want. You can use a relative path (relative to $ catalina_home), too

A absolute path can be used. ->

Directory = "Logs" prefix = "localhost_access_log." suffix = ". txt"

Pattern = "Common" resolvehosts = "false" />

->

DEFAULT (WHEN USING FILELOGGER), LOG Files Are Created in The "Logs"

Directory Relative to $ Catalina_Home. if you wish, you can specify

A DIFFERENT DIRECTORY THE "Directory" Attribute. Specify Either A

Relative (To $ Catalina_Home) or Absolute Path to the Desired

Directory .-->

The log file is created under the logs directory relative to the $ catalina_home directory. If you want, you can also

Specify a different path to Directory. You can use relative paths relative to $ Catalina_home, too

A absolute path can be used.

Directory = "Logs" prefix = "localhost_log." suffix = ". txt"

TimeStamp = "true" />

转载请注明原文地址:https://www.9cbs.com/read-75677.html

New Post(0)