<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Tomcat中server.xml配置介紹

    <Server port="8005" shutdown="SHUTDOWN" debug="0">  
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"

                debug="0"/>

    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"

                debug="0"/>

      <GlobalNamingResources>

    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

        <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>

      <Service name="Tomcat-Standalone">

        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"

    port="8080"               minProcessors="5" maxProcessors="75"

                   enableLookups="true" redirectPort="8443"

                   acceptCount="100" debug="0" connectionTimeout="20000"

                   useURIValidationHack="false" disableUploadTimeout="true" />

        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"

                   port="8009" minProcessors="5" maxProcessors="75"

                   enableLookups="true" redirectPort="8443"

                   acceptCount="10" debug="0" connectionTimeout="20000"

                   useURIValidationHack="false"

                   protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

    <Engine name="Standalone" defaultHost="localhost" debug="0">

    <!--

    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>

    -->

          <Logger className="org.apache.catalina.logger.FileLogger"

                  prefix="catalina_log." suffix=".txt"

                  timestamp="true"/>

          <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

                     debug="0" resourceName="UserDatabase"/>

          <Host name="localhost" debug="0" appBase="webapps"

           unpackWARs="true" autoDeploy="true">

            <Logger className="org.apache.catalina.logger.FileLogger"

                     directory="logs"  prefix="localhost_log." suffix=".txt"

                   timestamp="true"/>

    <Context path="/gdqy" reloadable="true" docBase="D:/gdqy/ept" debug="0"

    crossContext="true"/>

          </Host>

    </Engine>

      </Service>

    </Server>

    1server port:指定一個(gè)端口,這個(gè)端口負(fù)責(zé)監(jiān)聽關(guān)閉tomcat的請求

    2shut down:指定向端口發(fā)送的命令字符串

    3service name:指定service的名字

    4Connector(表示客戶端和service之間的連接)

    port 指定服務(wù)器端要?jiǎng)?chuàng)建的端口號,并在這個(gè)斷口監(jiān)聽來自客戶端的請求

    minProcessors:服務(wù)器啟動時(shí)創(chuàng)建的處理請求的線程數(shù)

    maxProcessors:最大可以創(chuàng)建的處理請求的線程數(shù)

    enableLookups:如果為true,則可以通過調(diào)用request.getRemoteHost()進(jìn)行DNS查詢來得到遠(yuǎn)程客戶端的實(shí)際主機(jī)名,若為false則不進(jìn)行DNS查詢,而是返回其ip地址

    redirectPort:指定服務(wù)器正在處理http請求時(shí)收到了一個(gè)SSL傳輸請求后重定向的端口號

    acceptCount 指定當(dāng)所有可以使用的處理請求的線程數(shù)都被使用時(shí),可以放到處理隊(duì)列中的請求數(shù),超過這個(gè)數(shù)的請求將不予處理

    connectionTimeout 指定超時(shí)的時(shí)間數(shù)(以毫秒為單位)
    5
    Engine(表示指定service中的請求處理機(jī),接收和處理來自Connector的請求)

    defaultHost:指定缺省的處理請求的主機(jī)名,它至少與其中的一個(gè)host元素的name屬性值是一樣的
    6
    Context(表示一個(gè)web應(yīng)用程序,通常為WAR文件,關(guān)于WAR的具體信息見servlet規(guī)范) docBase 應(yīng)用程序的路徑或者是WAR文件存放的路徑

    path:表示此web應(yīng)用程序的url的前綴,這樣請求的urlhttp://localhost:8080/path/****

    reloadable:這個(gè)屬性非常重要,如果為true,則tomcat會自動檢測應(yīng)用程序的/WEB-INF/lib /WEB-INF/classes目錄的變化,自動裝載新的應(yīng)用程序,我們可以在不重起tomcat的情況下改變應(yīng)用程序

    7host(表示一個(gè)虛擬主機(jī))

    name:指定主機(jī)名

    appBase:應(yīng)用程序基本目錄,即存放應(yīng)用程序的目錄

    unpackWARs:如果為true,則tomcat會自動將WAR文件解壓,否則不解壓,直接從WAR文件中運(yùn)行應(yīng)用程序

    8Logger(表示日志,調(diào)試和錯(cuò)誤信息)

    className 指定logger使用的類名,此類必須實(shí)現(xiàn)org.apache.catalina.Logger 接口

    prefix:指定log文件的前綴

    suffix:指定log文件的后綴

    timestamp:如果為true,則log文件名中要加入時(shí)間,如下例:localhost_log.2001-10-04.txt
    9
    Realm(表示存放用戶名,密碼及role的數(shù)據(jù)庫)

    className:指定Realm使用的類名,此類必須實(shí)現(xiàn)org.apache.catalina.Realm接口

    10Valve(功能與Logger差不多,其prefixsuffix屬性解釋和Logger 中的一樣)

    className:指定Valve使用的類名,如用org.apache.catalina.valves.AccessLogValve類可以記錄應(yīng)用程序的訪問信息

    11
    directory:指定log文件存放的位置

    pattern 有兩個(gè)值,common方式記錄遠(yuǎn)程主機(jī)名或ip地址,用戶名,日期,第一行請求的字符串,HTTP響應(yīng)代碼,發(fā)送的字節(jié)數(shù)。combined方式比common方式記錄的值更多。

    另附tomcat5中server.xml配置

    <!-- Example Server Configuration File -->
    <!-- Tomcat服務(wù)器配置示例文件 -->

    <!-- Note that component elements are nested corresponding to their
          parent-child relationships with each other -->
    <!-- 注意,這些組件的構(gòu)成是根據(jù)相互之間的父子關(guān)系進(jìn)行嵌套的。-->

    <!-- 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.
    -->
    <!-- 一個(gè)“Server”是一個(gè)提供完整的JVM的獨(dú)立組件,它可以包含一個(gè)或多個(gè)
          “Service”實(shí)例。服務(wù)器在指定的端口上監(jiān)聽shutdown命令。
        
          注意:一個(gè)“Server”自身不是一個(gè)“Container”(容器),因此在這里你
          不可以定義諸如“Valves”或者“Loggers”子組件
    -->

    <Server port="8005" shutdown="SHUTDOWN" debug="0">


       <!-- Comment these entries out to disable JMX MBeans support -->
       <!-- 這些指令組件關(guān)閉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描述文件配置自定義的組件,然后設(shè)置
            “descriptors”屬性為以“;”為分隔的文件名列表嚴(yán)將它添加到默認(rèn)列表
            中,例如:descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"。
    -->
          
       <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
                 debug="0"/>
       <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
                 debug="0"/>

       <!-- 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認(rèn)證用戶的用戶數(shù)據(jù)庫 -->
       
         <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.
        -->
       <!-- 一個(gè)“Service”是一個(gè)或多個(gè)共用一個(gè)單獨(dú)“Container”(容器)的“Connectors”
            組合(因此,應(yīng)用程序在容器中可見)。通常,這個(gè)容器是一個(gè)“Engine”
            (引擎),但這不是必須的。
          
            注意:一個(gè)“Service”自身不是一個(gè)容器,因此,在這個(gè)級別上你不可定義
            諸如“Valves”或“Loggers”子組件。
       -->

    posted on 2008-12-23 11:21 丁克設(shè)計(jì) 閱讀(573) 評論(0)  編輯  收藏 所屬分類: Tomcat 技術(shù)文檔

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導(dǎo)航

    留言簿(6)

    隨筆檔案

    文章分類

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 国产一级淫片a视频免费观看| 国产黄色免费观看| 精品亚洲AV无码一区二区三区 | 国产va免费精品观看精品| 99国产精品免费观看视频| 久久久久久影院久久久久免费精品国产小说 | 亚洲综合色区在线观看| 国产亚洲一区区二区在线| 成人免费网站久久久| 黄色免费网址大全| 九九久久国产精品免费热6| 国产成人无码精品久久久久免费| 2022国内精品免费福利视频| 怡红院免费全部视频在线视频| 亚洲高清有码中文字| 亚洲人成www在线播放| 亚洲国产无线乱码在线观看| 亚洲精品视频在线免费| 亚洲成电影在线观看青青| 国产亚洲精品VA片在线播放| 亚洲Av永久无码精品黑人| 免费一级毛片在线播放放视频| 亚洲精品视频免费| 亚洲午夜免费视频| 免费无码肉片在线观看| 亚洲毛片在线免费观看| 免费观看黄网站在线播放| 国产成人免费福利网站| 亚洲色成人中文字幕网站| 78成人精品电影在线播放日韩精品电影一区亚洲 | 一区国严二区亚洲三区| 97无码免费人妻超级碰碰夜夜| 免费无码又爽又刺激毛片| 亚洲第一成人影院| 国产美女精品视频免费观看| 久久精品亚洲乱码伦伦中文| 亚洲成色在线影院| 亚洲一卡2卡三卡4卡无卡下载| 国产成人亚洲合集青青草原精品 | 亚洲AV成人一区二区三区在线看| 国产成人综合亚洲|