]]>銆愯漿杞姐憈omcat鐨剆erver.xml錛堜腑鏂囩増錛?/title>http://www.tkk7.com/ranxiang/articles/23145.html鍐夌繑鍐夌繑Fri, 09 Dec 2005 07:19:00 GMThttp://www.tkk7.com/ranxiang/articles/23145.htmlhttp://www.tkk7.com/ranxiang/comments/23145.htmlhttp://www.tkk7.com/ranxiang/articles/23145.html#Feedback0http://www.tkk7.com/ranxiang/comments/commentRss/23145.htmlhttp://www.tkk7.com/ranxiang/services/trackbacks/23145.html
<!-- Tomcat鏈嶅姟鍣ㄩ厤緗ず渚嬫枃浠?-->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- 娉ㄦ剰錛岃繖浜涚粍浠剁殑鏋勬垚鏄牴鎹浉浜掍箣闂寸殑鐖跺瓙鍏崇郴榪涜宓屽鐨勩?->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<!-- 涓涓淪erver鈥濇槸涓涓彁渚涘畬鏁寸殑JVM鐨勭嫭绔嬬粍浠訛紝瀹冨彲浠ュ寘鍚竴涓垨澶氫釜
鈥淪ervice鈥濆疄渚嬨傛湇鍔″櫒鍦ㄦ寚瀹氱殑绔彛涓婄洃鍚瑂hutdown鍛戒護銆?br>
娉ㄦ剰錛氫竴涓淪erver鈥濊嚜韜笉鏄竴涓淐ontainer鈥濓紙瀹瑰櫒錛夛紝鍥犳鍦ㄨ繖閲屼綘
涓嶅彲浠ュ畾涔夎濡傗淰alves鈥濇垨鑰呪淟oggers鈥濆瓙緇勪歡
-->
<!-- Comment these entries out to disable JMX MBeans support -->
<!-- 榪欎簺鎸囦護緇勪歡鍏抽棴JMX MBeans鏀寔 -->
<!-- You may also configure custom components (e.g. Valves/Realms) by
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"
-->
<!-- 浣犱篃鍙互閫氳繃鍖呭惈浣犺嚜宸辯殑mbean鎻忚堪鏂囦歡閰嶇疆鑷畾涔夌殑緇勪歡錛岀劧鍚庤緗?br>
鈥渄escriptors鈥濆睘鎬т負浠モ滐紱鈥濅負鍒嗛殧鐨勬枃浠跺悕鍒楄〃涓ュ皢瀹冩坊鍔犲埌榛樿鍒楄〃
涓紝渚嬪錛歞escriptors="/com/myfirm/mypackage/mbean-descriptor.xml"銆?br>
-->
<!-- Global JNDI resources -->
<!-- 鍏ㄥ眬JNDI璧勬簮 -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<!-- 鍑轟簬紺轟緥鐩殑鐨勬祴璇曞叆鍙?-->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<!-- 鍙紪杈戠殑錛岀敤鏉ラ氳繃UserDatabaseRealm璁よ瘉鐢ㄦ埛鐨勭敤鎴鋒暟鎹簱 -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible
within that Container). Normally, 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.
-->
<!-- 涓涓淪ervice鈥濇槸涓涓垨澶氫釜鍏辯敤涓涓崟鐙淐ontainer鈥?瀹瑰櫒)鐨勨淐onnectors鈥?br>
緇勫悎錛堝洜姝わ紝搴旂敤紼嬪簭鍦ㄥ鍣ㄤ腑鍙錛夈傞氬父錛岃繖涓鍣ㄦ槸涓涓淓ngine鈥?br>
錛堝紩鎿庯級錛屼絾榪欎笉鏄繀欏葷殑銆?br>
娉ㄦ剰錛氫竴涓淪ervice鈥濊嚜韜笉鏄竴涓鍣紝鍥犳錛屽湪榪欎釜綰у埆涓婁綘涓嶅彲瀹氫箟
璇稿鈥淰alves鈥濇垨鈥淟oggers鈥濆瓙緇勪歡銆?br>
-->
<!-- Define the Tomcat Stand-Alone Service -->
<!-- 瀹氫箟Tomcat鐨勬爣鍑嗙嫭绔嬫湇鍔?-->
<Service name="Catalina">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) 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 Connector on 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
instructions):
* 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.
-->
<!-- 涓涓淐onnector鈥濓紙榪炴帴鍣級浠h〃涓涓姹傝鎺ユ敹鍜屽簲絳旀墍闇瑕佺殑绔偣銆傛瘡涓繛
鎺ュ櫒閫氳繃鐩稿叧鐨勨淐ontainer鈥濓紙瀹瑰櫒錛夊鐞嗚姹傘?br>
榛樿鎯呭喌涓嬶紝涓涓潪SSL鐨凥TTP/1.1鐨勮繛鎺ュ櫒琚粦瀹氬湪绔彛8080銆備綘涔熷彲浠ラ氳繃
鏍規嵁鍚庨潰鐨勪嬌鐢ㄨ鏄庡茍鍙栨秷絎簩涓繛鎺ュ櫒鍏ュ彛鐨勬敞閲婏紝鍦ㄧ鍙?443涓婂緩绔嬩竴涓?br>
SSL HTTP/1.1鐨勮繛鎺ュ櫒銆傚紑鏀維SL鏀寔闇瑕佷笅闈㈠嚑姝ワ紙鍙傝Tomcat 5鏂囨。涓庢牱
閰嶇疆SSL鐨勮鏄庝互鍙栧緱鏇村鐨勮緇嗕俊鎭級錛?br>
* 濡傛灉浣犵殑JDK鏄?.3鎴?.3浠ュ墠鐨勭増鏈紝涓嬭澆瀹夎JSSE 1.0.2鎴栦互鍚庣増鏈紝騫舵斁
緗甁AR鏂囦歡鍒扳?JAVA_HOME/jre/lib/ext鈥濈洰褰曚笅銆?br>
* 甯︿竴涓渃hangeit鈥濈殑鍙d護鍊兼墽琛岋細
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (UNIX)
鏉ョ敓鎴愬畠鑷繁鐨勮瘉涔︾閽ャ?br>
榛樿鎯呭喌涓嬶紝褰撲竴涓獁eb搴旂敤紼嬪簭璋冪敤璇鋒眰鏃訛紝DNS鏌ヨ鏄彲琛岀殑銆傝繖灝嗗鎬ц兘閫?br>
鎴愪竴浜涗笉鍒╃殑褰卞搷錛屽洜姝わ紝浣犲彲浠ュ皢鈥渆nableLookups鈥濊緗負鈥渇alse鈥濇潵鍏抽棴DNS
鏌ヨ銆傚綋DNS鏌ヨ琚叧闂椂錛宺equest.getRemoteHost()灝嗚繑鍥炲寘鍚繙紼嬪鎴稩P鍦?br>
鍧鐨勫瓧絎︿覆銆?br>
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<!-- 鍦?080绔彛涓婂畾涔変竴涓潪SSL鐨凥TTP/1.1榪炴帴鍣?-->
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- 娉ㄦ剰錛岃鍏抽棴榪炴帴瓚呮椂錛屽皢connectionTimeout璁劇疆涓? -->
<!-- Note : To use gzip compression you could set the following properties :
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!-- 鍦ㄧ鍙?443涓婂畾涔変竴涓猄SL鐨凥TTP/1.1鐨勮繛鎺ュ櫒 -->
<!--
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<!-- 鍦ㄧ鍙?009涓婂畾涔変竴涓狢oyote/JK2 AJP 1.3榪炴帴鍣?-->
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- 鍦?082绔彛涓婂畾涔変竴涓唬鐞咹TTP/1.1榪炴帴鍣?-->
<!-- See proxy documentation for more information about using this. -->
<!-- 鍙傝浠g悊鏂囨。浠ュ彇寰楄繖閲屼嬌鐢ㄥ睘鎬х殑鏇村鐨勪俊鎭?-->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->
<!-- 涓涓淓ngine鈥濓紙寮曟搸錛変唬琛ㄥ鐞嗘瘡涓姹傜殑鍏ュ彛鐐癸紙鍦–atalina鍐咃級銆傝繖涓猅omcat
鐨勬爣鍑嗙嫭绔嬪紩鎿庡疄鐜板垎鏋愬寘鍚湪璇鋒眰涓殑HTTP澶翠俊鎭紝騫跺皢璇鋒眰浼犻佸埌閫傚綋鐨勪富鏈?br>
鎴栬櫄鎷熶富鏈轟笂銆?->
<!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
<Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
-->
<!-- 浣犲簲璇ヨ繖鏍瘋緗甹vmRoute浠ヤ究鍦↗K/JK2閫氶亾涓婃敮鎸佽礋杞藉鉤琛★細
<Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<!-- 鍦ㄦ垜浠殑瀹瑰櫒浣撶郴涓畾涔夋渶楂樼駭鍒殑瀹瑰櫒 -->
<Engine name="Catalina" defaultHost="localhost" debug="0">
<!-- The request dumper valve dumps useful debugging information about
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 <Host> or <Context> 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 it. -->
<!-- 璇鋒眰杞偍鍣ㄥ艱漿鍌ㄩ潪甯告湁鐢ㄧ殑閫氳繃Tomcat榪欎釜瀹炰緥鎺ユ敹鍒扮殑鎵鏈夎姹傜殑錛屽叧浜?br>
鎺ユ敹鍒扮殑璇鋒眰澶村拰cookies錛屼互鍙婂彂閫佸嚭鐨勫洖搴斿ご鍜宑ookies鐨勮皟璇曚俊鎭傚鏋?br>
浣犲彧鍦ㄦ剰涓涓壒瀹氱殑铏氭嫙涓繪満鎴栬呬竴涓壒瀹氬簲鐢ㄧ▼搴忕殑璇鋒眰錛屽湪瀵瑰簲鐨?lt;Host>
鎴?lt;Context>鍏ュ彛涓鐢ㄨ繖涓厓绱犮?br>
瀵逛簬鎵鏈夌殑Servlet錛堝皬鏈嶅姟紼嬪簭錛?.4鏉ユ墍錛屽湪紺轟緥紼嬪簭涓楠?br>
鈥淩equestDumperFilter鈥濊繃婊ゆ槸闈炲父瀹規槗鐨勶紙榪欎釜榪囨護鍣ㄦ簮浠g爜鍙互鍦?br>
鈥?CATALINA_HOME/webapps/examples/WEB-INF/classes/filters鈥濅笅鎵懼埌銆?br>
璇鋒眰杞偍榛樿鎯呭喌涓嬫槸鍏抽棴鐨勶紝濡傛灉瑕佷嬌鐢ㄥ畠錛屽彇娑堜笅闈㈣鐨勬敞閲婄銆?->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Global logger unless overridden at lower levels -->
<!-- 鍏ㄥ眬鏃ュ織璁劇疆錛岄櫎闈炲湪鏇翠綆鐨勭駭鍒笂瑕嗙洊瀹冪殑璁劇疆 -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<!-- 鍥犱負榪欎釜Realm錛堝尯鍩燂級鍦ㄨ繖鍎匡紝鍥犳榪欎釜瀹炰緥灝嗚鍏ㄥ眬鍏變韓銆?-->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<!-- 榪欎釜Realm錛堝尯鍩燂級浣跨敤鍦ㄥ叏灞JNDI璧勬簮涓嬶紝鐢扁淯serDatabase鈥濋厤緗殑鐢ㄦ埛
鏁版嵁搴撱傞氳繃浣跨敤Realm灝嗕嬌瀵逛簬榪欎釜鐢ㄦ埛鏁版嵁搴撶殑浠諱綍緙栬緫閮藉皢浼氱珛鍗沖彲鐢?br>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<!-- 娉ㄩ噴鎺夋棫鏈夌殑Realm浠ヤ究鎴戜滑鑳藉緢蹇熺殑鎭㈠鏃ф湁閰嶇疆銆?-->
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!-- 涓嬮潰鐨勫睘鎬х敤浜庝粠鍌ㄥ瓨鍦ㄦ暟鎹簱鎴栦粠JDBC閫氶亾涓緱鍒扮殑Realm浠ュ彇浠d笂闈㈢殑
Realm閰嶇疆銆?->
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<!-- 瀹氫箟榛樿鐨勮櫄鎷熶富鏈?br>
娉ㄦ剰錛歑ML妯″紡紜灝嗕笉鑳戒笌Xerces 2.2鍚屽伐浣溿?br>
-->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
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:
涓鴻繖涓粨鐐瑰畾涔変竴涓兢闆嗭紝閫氳繃瀹氫箟榪欎釜鍏冪礌錛屾剰鍛崇潃姣忎釜綆$悊鍛橀兘灝嗚鏀瑰彉銆?br>
鍥犳錛屽綋榪愯涓涓兢闆嗘椂錛屽彧鏈夌‘璁ゅ湪蹇呴』琚仛闆嗗拰縐婚櫎鍏朵粬鐨勫湴鏂規湁浣犵殑
web杞歡銆?br>
涓涓兢闆嗘湁涓嬮潰榪欎簺鍙傛暟錛?br>
className = the fully qualified name of the cluster class
className = 榪欎釜緹ら泦綾葷殑鍏ㄩ檺瀹氬悕
name = a descriptive name for your cluster, can be anything
name = 浣犵殑緹ら泦鐨勬弿榪板悕錛屽彲浠ユ槸浠諱綍鎻忚堪
debug = the debug level, higher means more output
debug = 璋冭瘯綰у埆錛屾洿楂樻剰鍛崇潃鏇村鐨勮緭鍑?br>
mcastAddr = the multicast address, has to be the same for all the nodes
mcastAddr = 澶氭挱鍦板潃錛屾墍鏈夌殑鑺傜偣閮藉繀欏繪湁鍚屾牱鐨勫鎾湴鍧
mcastPort = the multicast port, has to be the same for all the nodes
mcastPort = 澶氭挱绔彛錛屽鎵鏈夌殑鑺傜偣閮藉繀欏繪湁鍚屾牱鐨勫鎾鍙?br>
mcastBindAddr = bind the multicast socket to a specific address
mcastBindAddr = 緇戝畾澶氭挱濂楁帴瀛楀埌涓涓寚瀹氱殑鍦板潃
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastTTL = 澶氭挱鐢熷瓨鏈燂紝濡傛灉浣犳兂瑕侀檺鍒朵綘鐨勫箍鎾殑璇?br>
mcastSoTimeout = the multicast readtimeout
mcastSoTimeout = 澶氭挱璇誨彇瓚呮椂
mcastFrequency = the number of milliseconds in between sending a "I'm
alive" heartbeat
mcastFrequency = 鍙戦佲淚'm alive鈥濓紙鎴戣繕媧葷潃錛変俊鎭殑闂撮殧姣鏁?br>
mcastDropTime = the number a milliseconds before a node is considered
"dead" if no heartbeat is received
mcastDropTime = 澶氶暱鏃墮棿娌℃湁鏀跺埌鈥淚'm alive鈥濆氨灝嗚繖涓妭鐐規爣璇嗕負姝昏妭鐐癸紙鍗曚綅錛氭縐掞級
tcpThreadCount = the number of threads to handle incoming replication
requests, optimal would be the same amount of threads as nodes
tcpThreadCount = 鐢ㄤ簬澶勭悊閲嶅寮曞叆璇鋒眰鐨勭嚎紼嬫暟錛屾渶濂芥槸姣忎釜鑺傜偣閮芥湁鐩稿悓鐨勭嚎紼嬫暟
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 = 鍦ㄦ湁澶氬潡浠ュお緗戝崱鐨勪富鏈轟笂鐨勭洃鍚琓CP緹ら泦璇鋒眰鐨勫湴鍧錛堢粦瀹氬湴鍧錛夛紝
auto鎰忓懗鐫鍦板潃鐢盜netAddress.getLocalHost().getHostAddress()鍙栧緱銆?br>
tcpListenPort = the tcp listen port
tcpListenPort = tcp鐩戝惉绔彛
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method
in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
tcpSelectorTimeout = 鍦ㄦ搷浣滅郴緇熶腑鏈塲ava.nio鍞ら啋閿欑殑鎯呭喌涓嬶紝浣跨敤Selector.select()鐨勮秴鏃?br>
姣鏁般傝涓?鍒欐病鏈夎秴鏃墮檺鍒?br>
printToScreen = true means that managers will also print to std.out
printToScreen = true鎰忓懗鐫綆$悊鍛樼殑鐩稿叧淇℃伅涔熷皢鎵撳嵃杈撳嚭鍒皊td.out
expireSessionsOnShutdown = true means that
expireSessionsOnShutdown = true 鎰忓懗鐫?????
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 = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
useDirtyFlag = true鎰忓懗鐫鎴戜滑鍙兘鍦ㄨ皟鐢╯etAttribute錛宺emoveAttribute鍚庢墠鑳藉鍒朵竴涓細璇濓紱
false鎰忓懗鐫鍦ㄦ瘡涓姹傚悗澶嶅埗浼氳瘽銆?br>
false鎰忓懗鐫澶嶅埗灝嗕互涓嬪垪浠g爜鏂瑰紡宸ヤ綔錛?br>
<%
HashMap map = (HashMap)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
until 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 then return to the client.
The "smart" queue is a queue where when a session is added to the
queue, and the same session
already exists in the queue from a previous request, that session will
be replaced
in the queue instead of replicating two requests. This almost never
happens, unless there is a
large network delay.
replicationMode = 鍙互鏄減ooled鈥濄佲渟ynchronous鈥濇垨鑰呪渁synchronous鈥?br>
* Pooled鎰忓懗鐫鍦ㄥ涓鎺ュ瓧涓婂悓姝ヨ繘琛屽鍒躲備緥濡傦紝鍏堝鍒舵暟鎹紝鐒跺悗璇鋒眰榪斿洖銆?br>
榪欎笌鈥渟ynchronous鈥濈浉鍚岋紝闄や簡瀹冧嬌鐢ㄤ竴涓鎺ュ瓧姹狅紝鍥犳錛屽畠鏄綰跨▼鐨勩傚畠鏄?br>
鏈蹇拰鏈楂樼駭鐨勮緗紝浣跨敤榪欎釜閰嶇疆涔熷鍔犱簡澶勭悊澶嶅埗鐨則cp綰跨▼鐨勫煙銆?br>
* Synchronous鎸囨墽琛岃姹傜殑綰跨▼錛屽畠涔熸槸鍚戝叾浠栬妭鐐瑰鍒舵暟鎹殑綰跨▼錛屽茍涓旂洿鍒?br>
鎵鏈夌殑鑺傜偣閮藉繁緇忔敹鍒頒俊鎭悗鎵嶈繑鍥炪?br>
* Asynchronous錛屽姣忎釜緹ら泦鑺傜偣鑰岃█錛岃繖鏄竴涓壒鍒殑鈥渟ender鈥濓紙鍙戦佽咃級綰跨▼錛?br>
鍥犳璇鋒眰綰跨▼灝嗗鍒惰姹傛帓闃熷埌涓涓皬闃熷垪涓紝鐒跺悗錛岃繑鍥炵粰鐢ㄦ埛銆?br>
榪欎釜灝忛槦鍒楁槸涓涓綋浼氳瘽琚坊鍔犲埌闃熷垪涓紝鑰屼粠鍏堝墠鐨勮姹備腑錛屽悓涓涓細璇濆繁緇忓瓨鍦?br>
錛岃繖涓細璇濆皢琚斁緗湪闃熷垪涓互浠f浛閲嶅鐨勪袱涓姹傘傝繖鍑犱箮浠庝笉浼氬彂鐢燂紝闄ら潪瀛樺湪
杈冨ぇ鐨勭綉緇滃歡榪熴?br>
-->
<!--
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 removeAttribute 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't escape out ; even if
you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session
after requests with the URI
ending with .gif and .js are intercepted.
-->
<!-- 褰撻厤緗兢闆嗘椂錛屼綘涔熸坊鍔犱竴涓兼潵鎹曡幏鎵鏈変紶鍏ョ殑璇鋒眰錛屽湪璇鋒眰緇撴潫鏃訛紝榪欎釜浼氳瘽鍙兘琚瓙澶嶅埗錛?br>
涔熷彲鑳戒笉琚鍒躲備竴涓細璇濇槸鍚﹀鍒跺彇鍐充簬涓嬪垪鏉′歡鏄惁鍙戠敓錛?br>
1. useDirtyFlag涓虹湡錛屾垨鑰卻etAttribute鎴栬卹emoveAttribute宸辯粡琚皟鐢ㄣ?br>
2. 浼氳瘽宸辯粡瀛樺湪錛堝繁緇忚鍒涘緩浜嗭級銆?br>
3. 璇鋒眰娌℃湁琚渇ilter鈥濆睘鎬ф墍鎹曡幏銆?br>
榪欎釜filter錛堣繃婊ゅ櫒錛夊睘鎬х敤浜庤繃婊ら偅浜涗笉鑳戒慨鏀逛細璇濈殑璇鋒眰錛屽洜姝わ紝鎴戜滑鍦ㄨ繖涓姹傜粨鏉熷悗涓嶅鍒?br>
浼氫富銆傝繖涓繃婊ゅ櫒鏄秷鏋佺殑錛屼緥濡傦紝浣犲悜榪囨護鍣ㄥ彂閫佷簡涓浜涗笢瑗匡紝鐒跺悗琚繃婊ゅ嚭鍘伙紝鍦ㄩ偅涓尮閰嶇殑榪?br>
婊ゅ櫒涓婁笉浼氬彂鐢熷鍒躲?br>
榪囨護鍣ㄥ睘鎬т互鍒嗗彿涓哄垎闅旓紝鍥犳浣犱笉鑳芥崲琛岋紝鍗充嬌浣犳兂榪欎箞鍋氥?br>
filter=".*\.gif;.*\.js;"鎰忓懗鐫鍦ㄨ繘琛屼互.gif鍜?js緇撴潫鐨刄RI璇鋒眰鍚庝笉澶嶅埗浼氳瘽銆?br>
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true">
<!-- Normally, users must authenticate themselves to each web app
individually. 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 then have that
user identity maintained across *all* web applications contained
in this virtual host. -->
<!-- 閫氬父錛屽姣忎竴涓簲鐢ㄧ▼搴忥紝鐢ㄦ埛蹇呴』閫愪釜鐨勮璇佷粬浠嚜宸便傚綋浠栦滑閬囧埌琚?br>
鏌愮瀹夊叏綰︽潫鎵淇濇姢鐨勮祫婧愭椂錛屽鏋滀綘鎯寵鐢ㄦ埛鍙湪絎竴嬈¤璁よ瘉錛岄偅涔堬紝
鍙栨秷涓嬮潰鍏ュ彛琛岀殑娉ㄩ噴錛岀劧鍚庡湪榪欎釜铏氭嫙涓繪満涓寘鍚繖涓敤鎴風殑錛屾í璺ㄦ墍鏈?br>
web搴旂敤紼嬪簭鐨勭敤鎴瘋韓浠借瘑鍒?->
<!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!-- 榪欎釜铏氭嫙涓繪満鐨勬墍鏈夎姹傜殑璁塊棶鏃ュ織榪囩▼銆傞粯璁ゆ儏鍐典笅錛屾棩蹇楁枃浠惰鍒涘緩鍦ㄧ浉瀵?br>
浜?CATALINA_HOME鐩綍涓嬬殑logs鐩綍涓嬨傞氳繃directory灞炴э紝浣犱篃鍙互鎸囧畾涓涓?br>
涓嶅悓鐨勭洰褰曪紝濡傛灉浣犳兂鐨勮瘽銆傚彲浠ヤ嬌鐢ㄧ浉瀵硅礬寰勶紙鐩稿浜?CATALINA_HOME錛夛紝涔?br>
鍙互浣跨敤緇濆璺緞銆?->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- Logger shared by all Contexts related to this virtual host. By
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 with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<!-- 涓庤繖涓櫄鎷熶富鏈烘湁鍏崇郴鎵鏈変笂涓嬫枃鎵鍏變韓鐨勬棩蹇椼傞粯璁ゆ儏鍐典笅錛堜嬌鐢‵ileLogger鏃訛級錛?br>
鏃ュ織鏂囦歡琚垱寤哄湪鐩稿浜?CATALINA_HOME鐩綍涓嬬殑logs鐩綍涓嬨傚鏋滀綘甯屾湜錛屼綘涔熷彲
浠ョ粰directory鎸囧畾涓涓笉鍚岀殑璺緞銆傚彲浠ヤ嬌鐢ㄧ浉瀵逛簬$CATALINA_HOME鐨勭浉瀵硅礬寰勶紝涔?br>
鍙互浣跨敤緇濆璺緞銆?br>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>