`
z75148885
  • 浏览: 184560 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Tomcat5下server.xml的解析

阅读更多
<!--ExampleServerConfigurationFile-->
<!--Tomcat服务器配置示例文件-->

<!--Notethatcomponentelementsarenestedcorrespondingtotheir
parent-childrelationshipswitheachother-->
<!--注意,这些组件的构成是根据相互之间的父子关系进行嵌套的。-->

<!--A"Server"isasingletonelementthatrepresentstheentireJVM,
whichmaycontainoneormore"Service"instances.TheServer
listensforashutdowncommandontheindicatedport.

Note:A"Server"isnotitselfa"Container",soyoumaynot
definesubcomponentssuchas"Valves"or"Loggers"atthislevel.
-->
<!--一个“Server”是一个提供完整的JVM的独立组件,它可以包含一个或多个
“Service”实例。服务器在指定的端口上监听shutdown命令。

注意:一个“Server”自身不是一个“Container”(容器),因此在这里你
不可以定义诸如“Valves”或者“Loggers”子组件
-->

<Serverport="8005"shutdown="SHUTDOWN"debug="0">


<!--CommenttheseentriesouttodisableJMXMBeanssupport-->
<!--这些指令组件关闭JMXMBeans支持-->

<!--Youmayalsoconfigurecustomcomponents(e.g.Valves/Realms)by
includingyourownmbean-descriptorfile(s),andsettingthe
"descriptors"attributetopointtoa';'seperatedlistofpaths
(intheClassLoadersense)offilestoaddtothedefaultlist.
e.g.descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
-->
<!--你也可以通过包含你自己的mbean描述文件配置自定义的组件,然后设置
“descriptors”属性为以“;”为分隔的文件名列表严将它添加到默认列表
中,例如:descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"。
-->

<ListenerclassName="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>

<!--GlobalJNDIresources-->
<!--全局JNDI资源-->
<GlobalNamingResources>

<!--Testentryfordemonstrationpurposes-->
<!--出于示例目的的测试入口-->
<Environmentname="simpleValue"type="java.lang.Integer"value="30"/>

<!--Editableuserdatabasethatcanalsobeusedby
UserDatabaseRealmtoauthenticateusers-->
<!--可编辑的,用来通过UserDatabaseRealm认证用户的用户数据库-->

<Resourcename="UserDatabase"auth="Container"
type="org.apache.catalina.UserDatabase"
description="Userdatabasethatcanbeupdatedandsaved">
</Resource>
<ResourceParamsname="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"isacollectionofoneormore"Connectors"thatshare
asingle"Container"(andthereforethewebapplicationsvisible
withinthatContainer).Normally,thatContainerisan"Engine",
butthisisnotrequired.

Note:A"Service"isnotitselfa"Container",soyoumaynot
definesubcomponentssuchas"Valves"or"Loggers"atthislevel.
-->
<!--一个“Service”是一个或多个共用一个单独“Container”(容器)的“Connectors”
组合(因此,应用程序在容器中可见)。通常,这个容器是一个“Engine”
(引擎),但这不是必须的。

注意:一个“Service”自身不是一个容器,因此,在这个级别上你不可定义
诸如“Valves”或“Loggers”子组件。
-->

<!--DefinetheTomcatStand-AloneService-->
<!--定义Tomcat的标准独立服务-->
<Servicename="Catalina">

<!--A"Connector"representsanendpointbywhichrequestsarereceived
andresponsesarereturned.EachConnectorpassesrequestsontothe
associated"Container"(normallyanEngine)forprocessing.

Bydefault,anon-SSLHTTP/1.1Connectorisestablishedonport8080.
YoucanalsoenableanSSLHTTP/1.1Connectoronport8443by
followingtheinstructionsbelowanduncommentingthesecondConnector
entry.SSLsupportrequiresthefollowingsteps(seetheSSLConfig
HOWTOintheTomcat5documentationbundleformoredetailed
instructions):
*IfyourJDKversion1.3orprior,downloadandinstallJSSE1.0.2or
later,andputtheJARfilesinto"$JAVA_HOME/jre/lib/ext".
*Execute:
%JAVA_HOME%\bin\keytool-genkey-aliastomcat-keyalgRSA(Windows)
$JAVA_HOME/bin/keytool-genkey-aliastomcat-keyalgRSA(Unix)
withapasswordvalueof"changeit"forboththecertificateand
thekeystoreitself.

Bydefault,DNSlookupsareenabledwhenawebapplicationcalls
request.getRemoteHost().Thiscanhaveanadverseimpacton
performance,soyoucandisableitbysettingthe
"enableLookups"attributeto"false".WhenDNSlookupsaredisabled,
request.getRemoteHost()willreturntheStringversionofthe
IPaddressoftheremoteclient.
-->
<!--一个“Connector”(连接器)代表一个请求被接收和应答所需要的端点。每个连
接器通过相关的“Container”(容器)处理请求。

默认情况下,一个非SSL的HTTP/1.1的连接器被绑定在端口8080。你也可以通过
根据后面的使用说明并取消第二个连接器入口的注释,在端口8443上建立一个
SSLHTTP/1.1的连接器。开放SSL支持需要下面几步(参见Tomcat5文档中怎样
配置SSL的说明以取得更多的详细信息):
*如果你的JDK是1.3或1.3以前的版本,下载安装JSSE1.0.2或以后版本,并放
置JAR文件到“$JAVA_HOME/jre/lib/ext”目录下。
*带一个“changeit”的口令值执行:
%JAVA_HOME%\bin\keytool-genkey-aliastomcat-keyalgRSA(Windows)
$JAVA_HOME/bin/keytool-genkey-aliastomcat-keyalgRSA(UNIX)
来生成它自己的证书私钥。

默认情况下,当一个web应用程序调用请求时,DNS查询是可行的。这将对性能造
成一些不利的影响,因此,你可以将“enableLookups”设置为“false”来关闭DNS
查询。当DNS查询被关闭时,request.getRemoteHost()将返回包含远程客户IP地
址的字符串。
-->

<!--Defineanon-SSLCoyoteHTTP/1.1Connectoronport8080-->
<!--在8080端口上定义一个非SSL的HTTP/1.1连接器-->
<Connectorport="8080"
maxThreads="150"minSpareThreads="25"maxSpareThreads="75"
enableLookups="false"redirectPort="8443"acceptCount="100"
debug="0"connectionTimeout="20000"
disableUploadTimeout="true"/>
<!--Note:Todisableconnectiontimeouts,setconnectionTimeoutvalue
to0-->
<!--注意,要关闭连接超时,将connectionTimeout设置为0-->

<!--Note:Tousegzipcompressionyoucouldsetthefollowingproperties:

compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla,traviata"
compressableMimeType="text/html,text/xml"
-->
<!--注意:要使用gzip压缩需要设置如下属性:

compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla,traviata"
compressableMimeType="text/html,text/xml"
-->

<!--DefineaSSLCoyoteHTTP/1.1Connectoronport8443-->
<!--在端口8443上定义一个SSL的HTTP/1.1的连接器-->
<!--
<Connectorport="8443"
maxThreads="150"minSpareThreads="25"maxSpareThreads="75"
enableLookups="false"disableUploadTimeout="true"
acceptCount="100"debug="0"scheme="https"secure="true"
clientAuth="false"sslProtocol="TLS"/>
-->

<!--DefineaCoyote/JK2AJP1.3Connectoronport8009-->
<!--在端口8009上定义一个Coyote/JK2AJP1.3连接器-->
<Connectorport="8009"
enableLookups="false"redirectPort="8443"debug="0"
protocol="AJP/1.3"/>

<!--DefineaProxiedHTTP/1.1Connectoronport8082-->
<!--在8082端口上定义一个代理HTTP/1.1连接器-->
<!--Seeproxydocumentationformoreinformationaboutusingthis.-->
<!--参见代理文档以取得这里使用属性的更多的信息。-->
<!--
<Connectorport="8082"
maxThreads="150"minSpareThreads="25"maxSpareThreads="75"
enableLookups="false"
acceptCount="100"debug="0"connectionTimeout="20000"
proxyPort="80"disableUploadTimeout="true"/>
-->

<!--AnEnginerepresentstheentrypoint(withinCatalina)thatprocesses
everyrequest.TheEngineimplementationforTomcatstandalone
analyzestheHTTPheadersincludedwiththerequest,andpassesthem
ontotheappropriateHost(virtualhost).-->
<!--一个“Engine”(引擎)代表处理每个请求的入口点(在Catalina内)。这个Tomcat
的标准独立引擎实现分析包含在请求中的HTTP头信息,并将请求传送到适当的主机
或虚拟主机上。-->

<!--YoushouldsetjvmRoutetosupportload-balancingviaJK/JK2ie:
<Enginename="Standalone"defaultHost="localhost"debug="0"jvmRoute="jvm1">
-->
<!--你应该这样设置jvmRoute以便在JK/JK2通道上支持负载平衡:
<Enginename="Standalone"defaultHost="localhost"debug="0"jvmRoute="jvm1">
-->

<!--Definethetoplevelcontainerinourcontainerhierarchy-->
<!--在我们的容器体系中定义最高级别的容器-->
<Enginename="Catalina"defaultHost="localhost"debug="0">

<!--Therequestdumpervalvedumpsusefuldebugginginformationabout
therequestheadersandcookiesthatwerereceived,andtheresponse
headersandcookiesthatweresent,forallrequestsreceivedby
thisinstanceofTomcat.Ifyoucareonlyaboutrequeststoa
particularvirtualhost,oraparticularapplication,nestthis
elementinsidethecorresponding<Host>or<Context>entryinstead.

ForasimilarmechanismthatisportabletoallServlet2.4
containers,checkoutthe"RequestDumperFilter"Filterinthe
exampleapplication(thesourceforthisfiltermaybefoundin
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").

Requestdumpingisdisabledbydefault.Uncommentthefollowing
elementtoenableit.-->
<!--请求转储器值转储非常有用的通过Tomcat这个实例接收到的所有请求的,关于
接收到的请求头和cookies,以及发送出的回应头和cookies的调试信息。如果
你只在意一个特定的虚拟主机或者一个特定应用程序的请求,在对应的<Host>
或<Context>入口中套用这个元素。

对于所有的Servlet(小服务程序)2.4来所,在示例程序中检验
“RequestDumperFilter”过滤是非常容易的(这个过滤器源代码可以在
“$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters”下找到。

请求转储默认情况下是关闭的,如果要使用它,取消下面行的注释符。-->
<!--
<ValveclassName="org.apache.catalina.valves.RequestDumperValve"/>
-->

<!--Globalloggerunlessoverriddenatlowerlevels-->
<!--全局日志设置,除非在更低的级别上覆盖它的设置-->
<LoggerclassName="org.apache.catalina.logger.FileLogger"
prefix="catalina_log."suffix=".txt"
timestamp="true"/>

<!--BecausethisRealmishere,aninstancewillbesharedglobally-->
<!--因为这个Realm(区域)在这儿,因此这个实例将被全局共享。-->

<!--ThisRealmusestheUserDatabaseconfiguredintheglobalJNDI
resourcesunderthekey"UserDatabase".Anyedits
thatareperformedagainstthisUserDatabaseareimmediately
availableforusebytheRealm.-->
<!--这个Realm(区域)使用在全局JNDI资源下,由“UserDatabase”配置的用户
数据库。通过使用Realm将使对于这个用户数据库的任何编辑都将会立即可用
<RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"
debug="0"resourceName="UserDatabase"/>

<!--Commentouttheoldrealmbutleaveherefornowincasewe
needtogobackquickly-->
<!--注释掉旧有的Realm以便我们能很快速的恢复旧有配置。-->
<!--
<RealmclassName="org.apache.catalina.realm.MemoryRealm"/>
-->

<!--ReplacetheaboveRealmwithoneofthefollowingtogetaRealm
storedinadatabaseandaccessedviaJDBC-->
<!--下面的属性用于从储存在数据库或从JDBC通道中得到的Realm以取代上面的
Realm配置。-->

<!--
<RealmclassName="org.apache.catalina.realm.JDBCRealm"debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test"connectionPassword="test"
userTable="users"userNameCol="user_name"userCredCol="user_pass"
userRoleTable="user_roles"roleNameCol="role_name"/>
-->

<!--
<RealmclassName="org.apache.catalina.realm.JDBCRealm"debug="99"
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"/>
-->

<!--
<RealmclassName="org.apache.catalina.realm.JDBCRealm"debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users"userNameCol="user_name"userCredCol="user_pass"
userRoleTable="user_roles"roleNameCol="role_name"/>
-->

<!--Definethedefaultvirtualhost
Note:XMLSchemavalidationwillnotworkwithXerces2.2.
-->
<!--定义默认的虚拟主机
注意:XML模式确认将不能与Xerces2.2同工作。
-->
<Hostname="localhost"debug="0"appBase="webapps"
unpackWARs="true"autoDeploy="true"
xmlValidation="false"xmlNamespaceAware="false">

<!--Definesaclusterforthisnode,
Bydefiningthiselement,meansthateverymanagerwillbechanged.
Sowhenrunningacluster,onlymakesurethatyouhavewebappsinthere
thatneedtobeclusteredandremovetheotherones.
Aclusterhasthefollowingparameters:
为这个结点定义一个群集,通过定义这个元素,意味着每个管理员都将被改变。
因此,当运行一个群集时,只有确认在必须被聚集和移除其他的地方有你的
web软件。
一个群集有下面这些参数:

className=thefullyqualifiednameoftheclusterclass
className=这个群集类的全限定名

name=adescriptivenameforyourcluster,canbeanything
name=你的群集的描述名,可以是任何描述

debug=thedebuglevel,highermeansmoreoutput
debug=调试级别,更高意味着更多的输出

mcastAddr=themulticastaddress,hastobethesameforallthenodes
mcastAddr=多播地址,所有的节点都必须有同样的多播地址

mcastPort=themulticastport,hastobethesameforallthenodes
mcastPort=多播端口,对所有的节点都必须有同样的多播端口

mcastBindAddr=bindthemulticastsockettoaspecificaddress
mcastBindAddr=绑定多播套接字到一个指定的地址

mcastTTL=themulticastTTLifyouwanttolimityourbroadcast
mcastTTL=多播生存期,如果你想要限制你的广播的话

mcastSoTimeout=themulticastreadtimeout
mcastSoTimeout=多播读取超时

mcastFrequency=thenumberofmillisecondsinbetweensendinga"I'malive"heartbeat
mcastFrequency=发送“I'malive”(我还活着)信息的间隔毫秒数

mcastDropTime=thenumberamillisecondsbeforeanodeisconsidered"dead"ifnoheartbeatisreceived
mcastDropTime=多长时间没有收到“I'malive”就将这个节点标识为死节点(单位:毫秒)

tcpThreadCount=thenumberofthreadstohandleincomingreplicationrequests,optimalwouldbethesameamountofthreadsasnodes
tcpThreadCount=用于处理重复引入请求的线程数,最好是每个节点都有相同的线程数

tcpListenAddress=thelistenaddress(bindaddress)forTCPclusterrequestonthishost,
incaseofmultipleethernetcards.
automeansthataddressbecomes
InetAddress.getLocalHost().getHostAddress()
tcpListenAddress=在有多块以太网卡的主机上的监听TCP群集请求的地址(绑定地址),
auto意味着地址由InetAddress.getLocalHost().getHostAddress()取得。

tcpListenPort=thetcplistenport
tcpListenPort=tcp监听端口

tcpSelectorTimeout=thetimeout(ms)fortheSelector.select()methodincasetheOS
hasawakupbuginjava.nio.Setto0fornotimeout
tcpSelectorTimeout=在操作系统中有java.nio唤醒错的情况下,使用Selector.select()的超时
毫秒数。设为0则没有超时限制

printToScreen=truemeansthatmanagerswillalsoprinttostd.out
printToScreen=true意味着管理员的相关信息也将打印输出到std.out

expireSessionsOnShutdown=truemeansthat
expireSessionsOnShutdown=true意味着?????

useDirtyFlag=truemeansthatweonlyreplicateasessionaftersetAttribute,removeAttributehasbeencalled.
falsemeanstoreplicatethesessionaftereachrequest.
falsemeansthatreplicationwouldworkforthefollowingpieceofcode:
<%
HashMapmap=(HashMap)session.getAttribute("map");
map.put("key","value");
%>
useDirtyFlag=true意味着我们只能在调用setAttribute,removeAttribute后才能复制一个会话;
false意味着在每个请求后复制会话。
false意味着复制将以下列代码方式工作:
<%
HashMapmap=(HashMap)session.getAttribute("map");
map.put("key","value");
%>

replicationMode=canbeeither'pooled','synchronous'or'asynchronous'.
*Pooledmeansthatthereplicationhappensusingseveralsocketsinasynchronousway.Ie,thedatagetsreplicated,thentherequestreturn.Thisisthesameasthe'synchronous'settingexceptitusesapoolofsockets,henceitismultithreaded.Thisisthefastestandsafestconfiguration.Tousethis,alsoincreasethenroftcpthreadsthatyouhavedealingwithreplication.
*Synchronousmeansthatthethreadthatexecutestherequest,isalsothe
threadthereplicatesthedatatotheothernodes,andwillnotreturnuntilall
nodeshavereceivedtheinformation.
*Asynchronousmeansthatthereisaspecific'sender'threadforeachclusternode,
sotherequestthreadwillqueuethereplicationrequestintoa"smart"queue,
andthenreturntotheclient.
The"smart"queueisaqueuewherewhenasessionisaddedtothequeue,andthesamesession
alreadyexistsinthequeuefromapreviousrequest,thatsessionwillbereplaced
inthequeueinsteadofreplicatingtworequests.Thisalmostneverhappens,unlessthereisa
largenetworkdelay.
replicationMode=可以是“pooled”、“synchronous”或者“asynchronous”
*Pooled意味着在多个套接字上同步进行复制。例如,先复制数据,然后请求返回。
这与“synchronous”相同,除了它使用一个套接字池,因此,它是多线程的。它是
最快和最高级的设置,使用这个配置也增加了处理复制的tcp线程的域。
*Synchronous指执行请求的线程,它也是向其他节点复制数据的线程,并且直到
所有的节点都己经收到信息后才返回。
*Asynchronous,对每个群集节点而言,这是一个特别的“sender”(发送者)线程,
因此请求线程将复制请求排队到一个小队列中,然后,返回给用户。
这个小队列是一个当会话被添加到队列中,而从先前的请求中,同一个会话己经存在
,这个会话将被放置在队列中以代替重复的两个请求。这几乎从不会发生,除非存在
较大的网络延迟。
-->
<!--
Whenconfiguringforclustering,youalsoaddinavalvetocatchalltherequests
comingin,attheendoftherequest,thesessionmayormaynotbereplicated.
Asessionisreplicatedifandonlyifalltheconditionsaremet:
1.useDirtyFlagistrueorsetAttributeorremoveAttributehasbeencalledAND
2.asessionexists(hasbeencreated)
3.therequestisnottrappedbythe"filter"attribute

Thefilterattributeistofilteroutrequeststhatcouldnotmodifythesession,
hencewedon'treplicatethesessionaftertheendofthisrequest.
Thefilterisnegative,ie,anythingyouputinthefilter,youmeantofilterout,
ie,noreplicationwillbedoneonrequeststhatmatchoneofthefilters.
Thefilterattributeisdelimitedby;,soyoucan'tescapeout;evenifyouwantedto.

filter=".*\.gif;.*\.js;"meansthatwewillnotreplicatethesessionafterrequestswiththeURI
endingwith.gifand.jsareintercepted.
-->
<!--当配置群集时,你也添加一个值来捕获所有传入的请求,在请求结束时,这个会话可能被子复制,
也可能不被复制。一个会话是否复制取决于下列条件是否发生:
1.useDirtyFlag为真,或者setAttribute或者removeAttribute己经被调用。
2.会话己经存在(己经被创建了)。
3.请求没有被“filter”属性所捕获。

这个filter(过滤器)属性用于过滤那些不能修改会话的请求,因此,我们在这个请求结束后不复制
会主。这个过滤器是消极的,例如,你向过滤器发送了一些东西,然后被过滤出去,在那个匹配的过
滤器上不会发生复制。
过滤器属性以分号为分隔,因此你不能换行,即使你想这么做。

filter=".*\.gif;.*\.js;"意味着在进行以.gif和.js结束的URI请求后不复制会话。

<!--
<ClusterclassName="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true">

<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>

<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>

<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"/>

<ValveclassName="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
</Cluster>
-->



<!--Normally,usersmustauthenticatethemselvestoeachwebapp
individually.Uncommentthefollowingentryifyouwouldlike
ausertobeauthenticatedthefirsttimetheyencountera
resourceprotectedbyasecurityconstraint,andthenhavethat
useridentitymaintainedacross*all*webapplicationscontained
inthisvirtualhost.-->
<!--通常,对每一个应用程序,用户必须逐个的认证他们自己。当他们遇到被
某种安全约束所保护的资源时,如果你想让用户只在第一次被认证,那么,
取消下面入口行的注释,然后在这个虚拟主机中包含这个用户的,横跨所有
web应用程序的用户身份识别。-->

<!--
<ValveclassName="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
-->

<!--Accesslogprocessesallrequestsforthisvirtualhost.By
default,logfilesarecreatedinthe"logs"directoryrelativeto
$CATALINA_HOME.Ifyouwish,youcanspecifyadifferent
directorywiththe"directory"attribute.Specifyeitherarelative
(to$CATALINA_HOME)orabsolutepathtothedesireddirectory.
-->
<!--这个虚拟主机的所有请求的访问日志过程。默认情况下,日志文件被创建在相对
于$CATALINA_HOME目录下的logs目录下。通过directory属性,你也可以指定一个
不同的目录,如果你想的话。可以使用相对路径(相对于$CATALINA_HOME),也
可以使用绝对路径。-->
<!--
<ValveclassName="org.apache.catalina.valves.AccessLogValve"
directory="logs"prefix="localhost_access_log."suffix=".txt"
pattern="common"resolveHosts="false"/>
-->

<!--LoggersharedbyallContextsrelatedtothisvirtualhost.By
default(whenusingFileLogger),logfilesarecreatedinthe"logs"
directoryrelativeto$CATALINA_HOME.Ifyouwish,youcanspecify
adifferentdirectorywiththe"directory"attribute.Specifyeithera
relative(to$CATALINA_HOME)orabsolutepathtothedesired
directory.-->
<!--与这个虚拟主机有关系所有上下文所共享的日志。默认情况下(使用FileLogger时),
日志文件被创建在相对于$CATALINA_HOME目录下的logs目录下。如果你希望,你也可
以给directory指定一个不同的路径。可以使用相对于$CATALINA_HOME的相对路径,也
可以使用绝对路径。
<LoggerclassName="org.apache.catalina.logger.FileLogger"
directory="logs"prefix="localhost_log."suffix=".txt"
timestamp="true"/>

</Host>

</Engine>

</Service>

</Server>
分享到:
评论

相关推荐

    tomcat配置文件web.xml与server.xml解析

    tomcat配置文件web.xml与server.xml解析

    tomcat的server.xml标签全解析.

    tomcat的server.xml配置文件中标签的完全解析. 让你不再盲目设置和拷备.

    server.xml常用配置详解.docx

    server.xml主要用来控制tomcat的运行,jboss的web容器其实是对tomcat的封装,一般在jboss\server\default\deploy\jbossweb-tomcat.sar目录下。

    tomcat7的配置文件server.xml解析

    这里对tomcat7的server.xml文件进行解释一下,方便在分析启动源码的时候理解Digester做的事情。 &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;Server port=8005 shutdown=SHUTDOWN&gt; &lt;Listener className=org....

    XML解析包(xalan.jar+xerces.jar+xml-apis.jar)

    当项目报关于XML文件无法解析的错误, 将三个包拷贝到tomcat...Xerces是XML解析器,Xalan是格式化器,xml-apis实际上是JAXP。一般App Server都会带上,JDK1.4也包含了解析器,不过不是Xerces,是Crimson,效率比较差。

    Tomcat设置maxPostSize实现过程解析

    找到tomcat目录下的/conf/server.xml,为其添加maxPostSize参数 ​ 参数值“-1”表示不做大小限制。不设置maxPostSize参数意为使用默认的大小,默认2097152bytes,即为2megabytes。 三、设值注意事项 需要注意一点的...

    JAVA WEB 开发详解:XML+XSLT+SERVLET+JSP 深入剖析与实例应用.part3

    4.19.5 指定文档缩进 161 4.19.6 指定媒体类型 161 4.20 xslt中的函数 162 4.21 数字格式化 162 4.22 查询和分组 164 4.23 处理多个输入文档 172 4.24 jaxp中的xslt api 175 4.24.1 转换器工厂 175 4.24.2 ...

    Tomcat6.x+IIS6+jk2 整合

    软件环境:Window server 2003+ IIS6.0 + Tomcat6.0 + JK2 ...tomcat的一些虚拟主机配置可以见配置文件server.xml 在访问过测试页后ISAPI筛选器"jakarta"会显示绿色箭头,红色是配置错误 不知道还有没有漏掉的 ^_^

    Tomcat6.x+IIS6+jk2最新整合

    我整我整整了我大半天,不过直得整合的好处就不说了 ...tomcat的一些虚拟主机配置可以见配置文件server.xml 在访问过测试页后ISAPI筛选器"jakarta"会显示绿色箭头,红色是配置错误 不知道还有没有漏掉的 ^^

    Tomcat面试专题及答案.pdf

    2)在 server.xml 文件上配置节点,设置相关的属性即可 3)通过 Catalina 来进行配置:进入到 conf\Catalina\localhost 文件下,创建一个 xml 文件,该文件的名字就是站点的名字。 编写 XML 的方式来进行设置。

    puppet-tomcat:基于实例的tomcat安装的Puppet模块

    当前支持RedHat框和Apache Tomcat 7.x或8.x模块说明模块功能: 多个Tomcat实例选择要以以下方式运行每个Tomcat实例的用户: 安装/删除认可的Java库(例如XML解析器) 安装/删除共享的Java库(例如数据库驱动程序) ...

    JAVA WEB 开发详解:XML+XSLT+SERVLET+JSP 深入剖析与实例应用.part5

    4.19.5 指定文档缩进 161 4.19.6 指定媒体类型 161 4.20 xslt中的函数 162 4.21 数字格式化 162 4.22 查询和分组 164 4.23 处理多个输入文档 172 4.24 jaxp中的xslt api 175 4.24.1 转换器工厂 175 4.24.2 ...

    JAVA WEB 开发详解:XML+XSLT+SERVLET+JSP 深入剖析与实例应用.part4

    4.19.5 指定文档缩进 161 4.19.6 指定媒体类型 161 4.20 xslt中的函数 162 4.21 数字格式化 162 4.22 查询和分组 164 4.23 处理多个输入文档 172 4.24 jaxp中的xslt api 175 4.24.1 转换器工厂 175 4.24.2 ...

    JAVA WEB 开发详解:XML+XSLT+SERVLET+JSP 深入剖析与实例应用.part2

    4.19.5 指定文档缩进 161 4.19.6 指定媒体类型 161 4.20 xslt中的函数 162 4.21 数字格式化 162 4.22 查询和分组 164 4.23 处理多个输入文档 172 4.24 jaxp中的xslt api 175 4.24.1 转换器工厂 175 4.24.2 ...

    tomcat8get请求url格式问题

    原因:由于tomcat的新版本增加了一个新特性,就是严格按照 RFC 3986规范进行访问解析,而 RFC 3986规范定义了Url中只允许包含英文字母(a-zA-Z)、数字(0-9)、-_.~4个特殊字符以及所有保留字符(RFC3986中指定了...

    axis1.4 部署解析webservie

    1.TOMCAT+AXIS的安装配置 首先机子上应该安装JDK1.5版本以上(带有XML解析包)。我这里是1.5.0.6 从APACHE的官方网站(www.apache.org)下载TOMCAT安装软件。下载版本要在4.0以上。这里用的是5.0版本。安装完后,...

    how-tomcat-works

    20.5.5 ManagedBean 165 20.5.6 BaseModelMBean 165 20.5.7 使用Modeler API 165 20.6 Catalian中的MBean 165 20.6.1 ClassNameMBean 165 20.6.2 StandardServerMBean 166 20.6.3 MBeanFactory 167 20.6.4 MBeanUtil...

    Java 面试宝典

    5、switch 语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上? .. 9 6、short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错? ....................... 9 7、char 型变量中能不...

Global site tag (gtag.js) - Google Analytics