锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲jizzjizz在线播放久,在线日韩日本国产亚洲,亚洲成A人片在线观看无码3Dhttp://www.tkk7.com/sealyu/archive/2010/05/18/321225.htmlsealsealMon, 17 May 2010 20:19:00 GMThttp://www.tkk7.com/sealyu/archive/2010/05/18/321225.htmlhttp://www.tkk7.com/sealyu/comments/321225.htmlhttp://www.tkk7.com/sealyu/archive/2010/05/18/321225.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/321225.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/321225.html TreeCache鏄竴縐嶇粨鏋勫寲鐨勩佸熀浜庡鍒剁殑浜嬪姟緙撳瓨銆俆reeCache鏄疛Boss搴旂敤鏈嶅姟鍣ㄤ腑闆嗙兢鏈嶅姟鈥斿寘鎷琂NDI闆嗙兢銆丠TTP鍜孍JB鐨? Sesssion闆嗙兢銆丣MS闆嗙兢鈥旂殑鍩虹妗嗘灦銆傚叾鍙互鍗曠嫭浣跨敤錛屽彲浠ラ泦鎴愬埌JBossAS搴旂敤錛屼篃鍙互闆嗘垚鍒板叾浠栫殑搴旂敤鏈嶅姟鍣ㄤ笂銆俆reeCache鏄? 涓縐嶆爲(wèi)鐘剁粨鏋勶紝姣忎釜鑺傜偣鎷ユ湁涓涓悕瀛楀拰澶氫釜鎴栬呮病鏈夊瓙鑺傜偣錛岄櫎璺熻妭鐐規(guī)病鏈夊瓙鑺傜偣鍏朵粬鑺傜偣鏈変笖鍙湁涓涓埗姣嶈妭鐐癸紝鍙互閫氳繃璺緞鍚嶆潵璁塊棶瀛愯妭鐐? 錛團QN錛欶ull Qualified Name錛夛紝鍦ㄤ竴涓猅reeCache涓彲浠ュ瓨鍦ㄥ媯墊爲(wèi)錛岋紝鍗沖彲浠ユ湁澶氫釜鏍硅妭鐐廣傚綋搴旂敤浜庡垎甯冨紡鐜鏃訛紝鐢變簬TreeCache鏄熀浜庡鍒剁殑錛屾瘡涓瓙鑺傜偣 鐨勫煎繀欏繪槸鍙簭鍒楀寲鐨勩?
     鍦ㄤ笅闈腑錛屽皢閫氳繃渚嬪瓙鏉ヤ簡瑙reeCache鐨勫姛鑳藉強鍏墮厤緗紝浣跨敤JBossCache1.4鍜孞DK5.0銆傞鍏堟槸涓涓渶鍩烘湰浣跨敤TreeCache 鐨勭▼搴忎緥瀛愬茍閰嶇疆涓涓猅reeCache鐨勯厤緗鏋訛紙鍚勭甯哥敤鐨勯厤緗彲鍙傝jboss-cache-dist-1.4.0.CR1鐗堟湰鐨別tc鐩綍錛屽涓? 鍚勭閰嶇疆鍙傝冧篃鍙璇ョ洰褰曚笅鐨勮寖渚嬮厤緗紝浠ヤ笅涓嶅啀寮鴻皟錛夛紝瑙佷笅錛?

treecache.xml錛?


<server>
    <mbean code="org.jboss.cache.TreeCache"
        name="jboss.cache:service=TreeCache">
        <depends>jboss:service=Naming</depends>
        <depends>jboss:service=TransactionManager</depends>
        <attribute name="ClusterName">TreeCache-Cluster</attribute>
        <attribute name="ClusterConfig">
            <config>
                <UDP mcast_addr="228.1.2.3" mcast_port="48866"
                    ip_ttl="64" ip_mcast="true"
                    mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                    ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                    loopback="false"/>
                <PING timeout="2000" num_initial_members="3"
                    up_thread="false" down_thread="false"/>
                <MERGE2 min_interval="10000" max_interval="20000"/>
                <FD_SOCK/>
                <VERIFY_SUSPECT timeout="1500"
                    up_thread="false" down_thread="false"/>
                <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
                    max_xmit_size="8192" up_thread="false" down_thread="false"/>
                <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
                    down_thread="false"/>
                <pbcast.STABLE desired_avg_gossip="20000"
                    up_thread="false" down_thread="false"/>
                <FRAG frag_size="8192"
                    down_thread="false" up_thread="false"/>
                <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
                    shun="true" print_local_addr="true"/>
                <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
            </config>
        </attribute>
    </mbean>
</server>
   鍏朵腑ClusterConfig閰嶇疆鍦ㄥ墠闈avaGroups鐨勪粙緇嶈緇嗕粙緇嶏紝鍏跺畠閰嶇疆姣旇緝綆鍗曪紝闇瑕佽繘涓姝ヤ簡瑙h鍙傝TreeCache鏂囨。銆?
   涓銆丆ache鍒嗙被
   TreeCache鎸夊姛鑳藉垎涓轟笁綾伙細鏈湴(Local)Cache銆佸鍒?Replication)Cache鍜屽け鏁? (Invalidation)Cache銆傛湰鍦癈ache鍙簲鐢ㄤ簬鏈湴鐜錛屽悗涓や釜Cache鍙簲鐢ㄤ簬鍒嗗竷寮忕幆澧冿紝鍏朵腑錛屽湪鍒嗗竷寮忕幆澧冧腑錛屽鍒禖ache 褰撲竴涓狢ache瀹炰緥鐨勪竴涓妭鐐瑰煎彂鐢熷彉鍖栨椂浼氬皢鍙樺寲澶嶅埗鍒板叾瀹冨疄渚嬩腑錛岃屽け鏁圕ache鏄綋涓涓狢ache瀹炰緥鐨勪竴涓妭鐐瑰煎彂鐢熷彉鍖栨椂浼氬皢鍏跺畠瀹炰緥鐨勭浉 搴旇妭鐐圭殑鍊艱涓虹┖錛岃鍏墮噸鏂板幓鑾峰緱璇ュ鹼紝鍙氳繃榪欑鏂瑰紡緙撳瓨澶у璞′互鍑忓皯鍦ㄥ疄渚嬩腑澶嶅埗瀵硅薄鐨勪唬浠楓傚垎甯冨紡Cache錛堝鍒跺拰澶辨晥Cache錛夊張鍒嗕負涓ょ錛? 鍚屾錛圧EPL_ASYNC錛夊拰寮傛錛圧EPL_SYNC錛夛紝鍚屾Cache鏄湪涓涓狢ache瀹炰緥鍋氫慨鏀規(guī)椂錛岀瓑寰呭彉鍖栧簲鐢ㄥ埌鍏跺畠瀹炰緥鍚庢墠榪斿洖錛岃屽紓姝? Cache鏄湪涓涓狢ache瀹炰緥鍋氫慨鏀規(guī)椂錛屽嵆鍒昏繑鍥炪傚叾閰嶇疆瑙佷笅錛?
!--
  Valid modes are LOCAL
                  REPL_ASYNC
                  REPL_SYNC
                  INVALIDATION_ASYNC
                  INVALIDATION_SYNC
->
attribute name="CacheMode">REPL_SYNC</attribute>

   浜屻佷簨鍔″拰騫惰(Transaction And Concurrent)
   TreeCache鏄竴縐嶄簨鍔ache錛屼笌JDBC涓鏍鳳紝鍏跺寘鎷袱鏂歸潰鍐呭錛氶攣鍜岄殧紱葷駭鍒傞攣鍒嗕負鎮(zhèn)茶閿佸拰涔愯閿侊紝褰撲嬌鐢ㄦ?zhèn)茶閿佹椨灱屽垎湄撲簲涓殧绂痪Uу埆錛? 鍒嗗埆鏄疭ERIALIZABLE銆丷EPEATABLE_READ (default)銆丷EAD_COMMITTED銆丷EAD_UNCOMMITTED鍜孨ONE錛岄殧紱葷駭鍒愭鍑忓急銆備箰瑙傞攣涔熷彨鐗堟湰閿侊紝鍏跺鏁版嵁榪涜鎿? 浣滄椂錛屽皢鍏跺鍒跺埌涓存椂鍖猴紝鎿嶄綔涔嬪悗灝嗙増鏈笌鍘熸湁鏁版嵁姣旇緝錛屽鏋滀竴鑷村垯灝嗛掑鐗堟湰騫跺啓鍥烇紝濡傛灉涓嶄竴鑷村垯鍥炴粴錛岀敱浜庝箰瑙傞攣浠呭湪澶嶅埗鍑烘暟鎹拰鎻愪氦鏁版嵁鏃跺鏁版嵁鍔? 閿侊紝鎵浠ュ茍琛屽害鏇撮珮錛屼絾濡傛灉鍐欐搷浣滄瘮杈冮綣佸湴璇濆垯瀹規(guī)槗鍑虹幇鍐茬獊瀵艱嚧鍥炴粴銆俆reeCache榛樿浣跨敤鎮(zhèn)茶閿併備嬌鐢═reeCache鏃訛紝闇瑕佷嬌鐢ㄥ鍣ㄦ彁渚? 鐨勪簨鍔$鐞嗗櫒錛屼竴鑸嬌JBossTransactionManagerLookup鍜孏enericTransactionManagerLookup錛? 鍓嶈呭簲鐢ㄤ簬JBOSS鏈嶅姟鍣紝鍚庤呭簲鐢ㄤ簬鍏朵粬鏈嶅姟鍣紝涔熷彲浣跨敤DummyTransactionManagerLookup鐢ㄤ簬嫻嬭瘯銆傚涓婁粙緇嶇殑閰嶇疆濡? 涓嬶細
attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
     <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>


   涓夈侀愬嚭絳栫暐(Eviction Policy)
   鐢變簬鍐呭瓨鏁伴噺鐨勫眬闄愶紝涓嶅彲鑳藉皢鎵鏈夌殑Cache鏁版嵁瀛樻斁鍦ㄥ唴瀛樹腑錛屼絾浣跨敤鍐呭瓨杈懼埌涓瀹氭瀬闄愭椂錛屼細灝嗛儴鍒嗘暟鎹竻闄ゅ嚭鍐呭瓨錛屼繚瀛樺埌鍏跺畠鎸佷箙濯掕川涓紝瀹氫箟鐨勪粈涔? 鏃跺欐竻闄ゃ佸浣曟竻闄ょ殑絳栫暐灝辨槸閫愬嚭絳栫暐銆傝嚜瀹氫箟涓涓愬嚭絳栫暐闇瑕佸疄鐜皁rg.jboss.cache.eviction.EvictionPolicy銆? org.jboss.cache.eviction.EvictionAlgorithm銆?
g.jboss.cache.eviction.EvictionQueue 鍜宱rg.jboss.cache.eviction.EvictionConfiguration鍥涗釜鎺ュ彛錛岀郴緇熸彁渚涗簡LRU(Least recently used錛屾渶榪戞渶灝戜嬌鐢?銆丩FU(Least Frequently Used鏈涓嶇粡甯鎬嬌鐢?銆丗IFO(First In First Out鍏堣繘鍏堝嚭)銆丮RU(Most Recently Used鏈榪戞渶緇忓父浣跨敤)鍥涚瀹炵幇錛岃緇嗗弬瑙乷rg.jboss.cache.eviction鍖呯殑婧愪唬鐮併傞厤緗涓嬶細
<attribute name="EvictionPolicyConfig">
   <config>
      <attribute name="wakeUpIntervalSeconds">5</attribute>
      <region name="/_default_">
        <attribute name="maxNodes">5000</attribute>
        <attribute name="timeToLiveSeconds">1000</attribute>
      </region>
      <region name="/org/jboss/data"
policyClass="org.jboss.cache.eviction.FIFOPolicy">
        <attribute name="maxNodes">5000</attribute>
      </region>
      <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
        <attribute name="maxNodes">10000</attribute>
      </region>
      <region name="/maxAgeTest/">
        <attribute name="maxNodes">10000</attribute>
        <attribute name="timeToLiveSeconds">8</attribute>
        <attribute name="maxAgeSeconds">10</attribute>
      </region>
   </config>
</attribute>
     鍥涖丆ache鍔犺澆
  鐢變簬閫愬嚭絳栫暐鐨勫瓨鍦紝閭d箞褰撴垜浠噸鏂伴渶瑕佽幏寰椾竴涓師鏉ュ湪緙撳瓨涓絾紜敱鍐呭瓨鍘熷洜琚愬嚭鐨勬暟鎹椂錛屽氨闇瑕佸畾涔変竴縐嶅姞杞界瓥鐣ワ紝浣垮湴鍙互閲嶆柊鎵懼洖鏁版嵁錛屽悓 鏃訛紝Cache鍔犺澆涔熻偐璐熷湪灝嗘暟鎹愬嚭鏃跺皢鏁版嵁淇濆瓨鍒版寔涔呭獟璐ㄧ殑璐d換銆?
  鏍規(guī)嵁灝嗘暟鎹繚瀛樺獟璐ㄧ殑涓嶅悓錛孋ache鍔犺澆鍖呮嫭F(xiàn)ileCacheLoader銆丣DBCCacheLoader絳夌瓑錛屽彲浠ュ悓鏃朵嬌鐢ㄥ縐嶅姞杞藉櫒鏉ョ伒媧誨畾鍒? 鍔犺澆絳栫暐銆備緥瑙佷笅錛?
<attribute name="CacheLoaderConfiguration">
    <config>
        <passivation>false</passivation>
        <preload>/</preload>
        <shared>true</shared>
        <cacheloader>
            <class>org.jboss.cache.loader.ClusteredCacheLoader</class>
            <properties>
                 timeout=1000
            </properties>
            <async>true</async>
            <fetchPersistentState>false</fetchPersistentState>
            ignoreModifications>false</ignoreModifications>
            <purgeOnStartup>false</purgeOnStartup>
        </cacheloader>
        <cacheloader>
            <class>org.jboss.cache.loader.JDBCCacheLoader</class>
            <properties>
                        cache.jdbc.table.name=jbosscache
                        cache.jdbc.table.create=true
                        cache.jdbc.table.drop=true
                        cache.jdbc.table.primarykey=jbosscache_pk
                        cache.jdbc.fqn.column=fqn
                        cache.jdbc.fqn.type=varchar(255)
                        cache.jdbc.node.column=node
                        cache.jdbc.node.type=longblob
                        cache.jdbc.parent.column=parent
                        cache.jdbc.driver=com.mysql.jdbc.Driver
                        cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
                        cache.jdbc.user=root
                        cache.jdbc.password=
             </properties>
             <async>true</async>
             <fetchPersistentState>false</fetchPersistentState>
             <purgeOnStartup>false</purgeOnStartup>
         </cacheloader>
    </config>
</attribute>

鎴戜滑灝嗛氳繃瀹氬埗濡備笂鐨勯厤緗俊鎭互鏇存湁鏁堝湴浣跨敤JBossCache銆傝緇嗘儏鍐靛彲鍙傝僇Boss TreeCache鍙傝冩枃妗e拰鑼冧緥銆?

TreeCache tree = new TreeCache();
tree.setClusterProperties("treecache.xml";
tree.createService();
tree.startService();
tree.put("/a/b/c", "name", "Ben";
tree.put("/a/b/c/d", "uid", new Integer(322649));
Integer tmp = (Integer) tree.get("/a/b/c/d", "uid";
tree.remove("/a/b";
tree.stopService();
tree.destroyService();


seal 2010-05-18 04:19 鍙戣〃璇勮
]]>
Tomcat閰嶇疆SSL鍚庝嬌鐢ㄤ唬鐞嗙鍒扮殑闂http://www.tkk7.com/sealyu/archive/2010/01/13/309293.htmlsealsealWed, 13 Jan 2010 04:49:00 GMThttp://www.tkk7.com/sealyu/archive/2010/01/13/309293.htmlhttp://www.tkk7.com/sealyu/comments/309293.htmlhttp://www.tkk7.com/sealyu/archive/2010/01/13/309293.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/309293.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/309293.html 浣嗘槸鍦ㄥ埆鐨勬満瀛愪笂璁塊棶鏃舵繪槸鎶ラ敊錛?
緗戠粶璁塊棶娑堟伅: 鏃犳硶鏄劇ず姝ら〉
 
鎶鏈俊鎭?渚涙敮鎸佷漢鍛樹嬌鐢?
閿欒浠g爜: 502 Proxy Error銆俆he specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
IP 鍦板潃: xxx.xx.xxx.xx
鏃ユ湡: 2010-1-13 4:35:17 [GMT]
鏈嶅姟鍣? isa-srv.xxxx.com

鍏朵腑鐨処P鍦板潃鏄垜浠叕鍙鎬唬鐞嗙殑鍦板潃錛屾湇鍔″櫒鏄叕鍙鎬唬鐞嗘湇鍔″櫒銆?br /> 鍦ㄧ綉涓婃病鏈夋壘鍒拌В鍐蟲柟娉曪紝緇忚繃鍒嗘瀽閿欒淇℃伅錛屽彂鐜板緢澶氬疄鐢?43绔彛鑰屼笉鏄痶omcat鐨?443绔彛鏉ヨ闂甋SL緗戝潃錛屼慨鏀逛簡tomcat涓嬬殑server.xml鏂囦歡錛屾灉鐒墮棶棰樿В鍐熾?br />


seal 2010-01-13 12:49 鍙戣〃璇勮
]]>
Apache Tomcat 6.0 SSL Configuration HOW-TOhttp://www.tkk7.com/sealyu/archive/2010/01/13/309265.htmlsealsealWed, 13 Jan 2010 00:43:00 GMThttp://www.tkk7.com/sealyu/archive/2010/01/13/309265.htmlhttp://www.tkk7.com/sealyu/comments/309265.htmlhttp://www.tkk7.com/sealyu/archive/2010/01/13/309265.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/309265.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/309265.html闃呰鍏ㄦ枃

seal 2010-01-13 08:43 鍙戣〃璇勮
]]>
Tomcat SSL閰嶇疆澶у叏錛堣漿錛?/title><link>http://www.tkk7.com/sealyu/archive/2010/01/13/309264.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Wed, 13 Jan 2010 00:29:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2010/01/13/309264.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/309264.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2010/01/13/309264.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/309264.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/309264.html</trackback:ping><description><![CDATA[<p>涓銆佸噯澶囧伐浣?br />     1). 瀹夎JDK 1.5 鎴栨洿楂樼増鏈紝 騫墮厤緗甁AVA_HOME 鐜鍙橀噺;<br />     2). 瀹夎tomcat 6 ;<br />    <br /> 浜屻侀厤緗繃紼?br />     1.鐢熸垚 server key 錛?br />       浠ュ懡浠よ鏂瑰紡鍒囨崲鍒扮洰褰?tomcat_HOME%錛屽湪command鍛戒護琛岃緭鍏ュ涓嬪懡浠わ紙jdk1.4浠ヤ笂甯︾殑宸ュ叿錛夛細 <br />       keytool -genkey -alias tomcat -keyalg RSA -keypass changit -storepass changit -keystore server.keystore -validity 3600 <br />       <br />       鐢ㄦ埛鍚嶈緭鍏ュ煙鍚嶏紝濡俵ocalhost錛堝紑鍙戞垨嫻嬭瘯鐢級鎴杊ostname.domainname(鐢ㄦ埛鎷ユ湁鐨勫煙鍚?錛屽叾瀹冨叏閮ㄤ互 enter 璺寵繃錛屾渶鍚庣‘璁わ紝<br />       姝ゆ椂浼氬湪%JAVA_HOME%/bin涓嬬敓鎴恠erver.keystore 鏂囦歡銆?br />       <br />       娉細鍙傛暟 -validity 鎸囪瘉涔︾殑鏈夋晥鏈?澶?錛岀己鐪佹湁鏁堟湡寰堢煭錛屽彧鏈?0澶┿?br />     <br />     2.灝嗚瘉涔﹀鍏ョ殑JDK鐨勮瘉涔︿俊浠誨簱涓?<br />       榪欐瀵逛簬tomcat鐨凷SL閰嶇疆涓嶆槸蹇呴』錛屼絾瀵逛簬CAS SSO鏄繀欏葷殑錛屽惁鍒欎細鍑虹幇濡備笅閿欒錛歟du.yale.its.tp.cas.client.CASAuthenticationException: Unable to validate ProxyTicketValidator銆傘傘?br />       <br />       瀵煎叆榪囩▼鍒?姝ワ紝絎竴姝ユ槸瀵煎嚭璇佷功錛岀浜屾鏄鍏ュ埌璇佷功淇′換搴擄紝鍛戒護濡備笅錛?br />       keytool -export -trustcacerts -alias tomcat -file server.cer -keystore  server.keystore -storepass changit<br />       <br />       keytool -import -trustcacerts -alias tomcat -file server.cer -keystore  %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit<br />       <br />       濡傛灉鏈夋彁紺猴紝杈撳叆Y灝卞彲浠ヤ簡銆?br />    <br />    鍏朵粬鏈夌敤keytool鍛戒護錛堝垪鍑轟俊浠昏瘉涔﹀簱涓墍鏈夊凡鏈夎瘉涔︼紝鍒犻櫎搴撲腑鏌愪釜璇佷功錛夛細<br />    <br />    keytool -list -v -keystore %JAVA_HOME%/jre/lib/security/cacerts<br />    keytool -delete -trustcacerts -alias tomcat  -keystore  %JAVA_HOME%/jre/lib/security/cacerts -storepass changit</p> <p>  3.閰嶇疆tomcat :<br />    淇敼%TOMCAT_HOME%"conf"server.xml錛屼互鏂囧瓧緙栬緫鍣ㄦ墦寮錛屾煡鎵捐繖涓琛岋細<br />    xml 浠g爜<br />    <br />    灝嗕箣鍚庣殑閭f鐨勬敞閲婂幓鎺夛紝騫跺姞涓?keystorePass鍙妅eystoreFile灞炴с?br />    娉ㄦ剰錛宼omcat涓嶅悓鐗堟湰閰嶇疆鏄笉鍚岀殑:<br />    tomcat4.1.34閰嶇疆錛?br />    xml 浠g爜     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"             port="8443" enableLookups="true" scheme="https" secure="true"             acceptCount="100"             useURIValidationHack="false" disableUploadTimeout="true"             clientAuth="false" sslProtocol="TLS"               keystoreFile="server.keystore"               keystorePass="changit"/>  tomcat5.5.9閰嶇疆錛?br />    <br />      <br />    xml 浠g爜<br />       <br />    <Connector port="8443" maxHttpHeaderSize="8192"   <br />               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"   <br />               enableLookups="false" disableUploadTimeout="true"   <br />               acceptCount="100" scheme="https" secure="true"   <br />               clientAuth="false" sslProtocol="TLS"     <br />               keystoreFile="server.keystore"     <br />               keystorePass="changit"/>   <br />    tomcat5.5.20閰嶇疆(姝ら厤緗悓鏍峰彲鐢ㄤ簬tomcat6.0)錛?br />     <br />    xml 浠g爜<br />       <br />    <Connector protocol="org.apache.coyote.http11.Http11Protocol"     <br />                         port="8443" maxHttpHeaderSize="8192"   <br />               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"   <br />               enableLookups="false" disableUploadTimeout="true"   <br />               acceptCount="100" scheme="https" secure="true"   <br />               clientAuth="false" sslProtocol="TLS"                    <br />               keystoreFile="server.keystore"     <br />               keystorePass="changit"/>   <br />    tomcat6.0.10閰嶇疆錛?br />    <br />    xml 浠g爜<br />    <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"   <br />               port="8443" minSpareThreads="5" maxSpareThreads="75"   <br />               enableLookups="true" disableUploadTimeout="true"     <br />               acceptCount="100"  maxThreads="200"   <br />               scheme="https" secure="true" SSLEnabled="true"   <br />               clientAuth="false" sslProtocol="TLS"   <br />               keystoreFile="server.keystore"     <br />               keystorePass="changit"/>   <br />    tomcat6鏀寔3縐嶏紝璇峰弬鑰冧互涓嬫枃妗o細<br />    <a >http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html</a> <br />    <br />   4.楠岃瘉閰嶇疆<br />    璁塊棶 <a href="https://localhost:8443/">https://localhost:8443/</a><br />    <connector protocol="org.apache.coyote.http11.Http11NioProtocol"></connector><br />    <br />   5. 濡傛灉榛樿鎯崇敤HTTPS 鏂瑰紡榪涜緗戠珯, 鍙互浣滃涓嬮厤緗?<br />   涓鑸琓omcat榛樿鐨凷SL绔彛鍙鋒槸8443錛屼絾鏄浜嶴SL鏍囧噯绔彛鍙鋒槸443錛?br />   榪欐牱鍦ㄨ闂綉欏電殑鏃跺欙紝鐩存帴浣跨敤https鑰屼笉闇瑕佽緭鍏ョ鍙e彿灝卞彲浠ヨ闂紝濡?a href="https://localhost/">https://localhost</a><br />   <br />    1).non-SSL HTTP/1.1 Connector瀹氫箟鐨勫湴鏂癸紝涓鑸涓嬶細<br />         <Connector port="80" maxHttpHeaderSize="8192"  scheme="https" <br />                 maxThreads="500" minSpareThreads="25" maxSpareThreads="75" <br />                 enableLookups="false" redirectPort="443" acceptCount="100" <br />                 connectionTimeout="20000" disableUploadTimeout="true" />   <br />   <br />       灝嗗叾涓殑redirectPort绔彛鍙鋒敼涓猴細443 </p> <p>   2).SSL HTTP/1.1 Connector瀹氫箟鐨勫湴鏂癸紝淇敼绔彛鍙蜂負錛?43錛屽涓嬶細<br />        <Connector     <br />        port="443" maxHttpHeaderSize="8192" <br />        maxThreads="150" minSpareThreads="25" <br />        maxSpareThreads="75" <br />        enableLookups="false" <br />        disableUploadTimeout="true" <br />        acceptCount="100" scheme="https" <br />        secure="true" <br />        clientAuth="false" sslProtocol="TLS" <br />         SSLEnabled="true"   <br />        keystoreFile="e:/server.keystore" <br />        keystorePass="changit" /><br />     3).AJP 1.3 Connector瀹氫箟鐨勫湴鏂癸紝淇敼redirectPort涓?43錛屽涓嬶細   <br />     <Connector port="8009" <br />           enableLookups="false" redirectPort="443" protocol="AJP/1.3" /><br />                     <br />                     <br />    濡備笂閰嶇疆濂藉悗渚垮彲浠ョ敤 <a href="https://localhost/">Https://localhost</a> 鏂瑰紡鐩存帴璁塊棶,鏃犻渶杈撳叆绔彛鍙?</p> <p>涓夈佸弬鑰冭祫鏂?br />   1. Keytool浣跨敤鎸囧崡錛?br />     <a >http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html</a><br />  <br />   2. tomcat-ssl閰嶇疆鎸囧崡錛?br />     <a >http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html</a><br />     <a >http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html</a></p> <img src ="http://www.tkk7.com/sealyu/aggbug/309264.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2010-01-13 08:29 <a href="http://www.tkk7.com/sealyu/archive/2010/01/13/309264.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>濡備綍絀胯繃闃茬伀澧欒皟鐢↗Boss(杞?http://www.tkk7.com/sealyu/archive/2009/10/29/300136.htmlsealsealThu, 29 Oct 2009 02:19:00 GMThttp://www.tkk7.com/sealyu/archive/2009/10/29/300136.htmlhttp://www.tkk7.com/sealyu/comments/300136.htmlhttp://www.tkk7.com/sealyu/archive/2009/10/29/300136.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/300136.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/300136.html1.棣栧厛淇敼jboss-service.xml錛屽湪ejb绔彛1098闄勮繎錛屼慨鏀笴allByValue鍊間負true
<attribute name="CallByValue">true</attribute>

2.鐒跺悗淇敼ejb3.deployer涓璲boss-service.xml鏂囦歡錛屼富瑕佹槸娣誨姞鍩熷悕鍒?873鐨勮皟鐢ㄤ腑
   <mbean code="org.jboss.remoting.transport.Connector"
          xmbean-dd="org/jboss/remoting/transport/Connector.xml"
          name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
      <depends>jboss.aop:service=AspectDeployer</depends>
      <attribute name="Configuration">
    <config>
     <invoker transport="socket">
     <attribute name="numAcceptThreads">1</attribute>
     <attribute name="maxPoolSize">300</attribute>
     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
     <attribute name="timeout" isParam="true">60000</attribute>
     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
     <attribute name="serverBindPort">3873</attribute>
     <!-- that's the important setting -->
     <attribute name="clientConnectAddress">10.104.46.119</attribute>
     <attribute name="clientConnectPort">3873</attribute>
     <attribute name="backlog">200</attribute>
     </invoker>
     <handlers>
     <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
     </handlers>
    </config>
      </attribute>
   </mbean>

3.璁劇疆java鍚姩閫夐」錛屾坊鍔爎mi-server鐨勫閮ㄥ湴鍧鍜岀鐢ㄦ湰鍦板煙鍚嶈В鏋愬埌鍚姩鑴氭湰
Windows鑴氭湰渚嬶細set JAVA_OPTS=-Djava.rmi.server.hostname= external IP -Djava.rmi.server.useLocalHostname=false
Unix鑴氭湰渚嬶細娣誨姞鍒癹boss鍚姩閰嶇疆鏂囦歡run.conf涓嵆鍙?/p>

4.鐢╮un.sh --host=192.168.1.25鍚姩鏈嶅姟鎴栨坊鍔?-host=192.168.1.25鍒板惎鍔ㄨ剼鏈?/p>

1.鍦ㄤ嬌鐢?span style="background-color: #ffff00;">Jboss 4.2GA 閬囧埌鐨勯棶棰? 浠ヤ笅鏄互default 妯″紡鍚姩鐨?span style="background-color: #ffff00;">Jboss .鍚姩鍙傛暟 -c default /all
(1). localhost鍙互璁塊棶涓庢湰鏈篒P涓嶈兘璁塊棶
瑙e喅鏂瑰紡錛?
淇敼JBOSS_HOME"server"default"deploy"jboss-web.deployer涓嬬殑server.xml 灝哸ddress鏀逛負0.0.0.0鎴栬呬綘鐨勫疄闄匢P 閲嶅惎 JBOSS 鐒跺悗灝卞彲浠ラ氳繃ip璁塊棶銆?/p>

(3)鍦╳indows 瀹㈡埛绔皟鐢?Linux 鏈嶅姟绔?閬囧埌org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://127.0.0.1:3873/]
瑙e喅鏂規(guī)硶: 淇敼 JBOSS_HOME/server/default/deploy/ejb3.deployer/META-INF/jboss-services.xml 鏂囦歡涓殑${jboss.bind.address}:3873 涓簂inux_home_ip:3873

浠ヤ笂涓や釜闂涔熷彲浠ラ氳繃浠ヤ笅璁劇疆瑙e喅錛?
For Windows, use
run.bat -b 0.0.0.0

for Linux use
run.sh -b 0.0.0.0



seal 2009-10-29 10:19 鍙戣〃璇勮
]]>
tomcat閿欒錛歋etPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to xxxxhttp://www.tkk7.com/sealyu/archive/2009/10/20/299061.htmlsealsealTue, 20 Oct 2009 08:44:00 GMThttp://www.tkk7.com/sealyu/archive/2009/10/20/299061.htmlhttp://www.tkk7.com/sealyu/comments/299061.htmlhttp://www.tkk7.com/sealyu/archive/2009/10/20/299061.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/299061.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/299061.html
<Context docBase="..." path="/cont" source="org.eclipse.jst.j2ee.server:*"/>

瑙e喅鏂規(guī)硶鏄湪Server鐨勯厤緗晫闈腑閫変腑"Publish module contexts to separate XML files"閫夐」銆?

seal 2009-10-20 16:44 鍙戣〃璇勮
]]>
JBOSS緇存姢緇忛獙錛堣漿錛?/title><link>http://www.tkk7.com/sealyu/archive/2009/09/22/296024.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Tue, 22 Sep 2009 06:48:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2009/09/22/296024.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/296024.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2009/09/22/296024.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/296024.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/296024.html</trackback:ping><description><![CDATA[<h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">1.JBOSS</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">鏈嶅姟鐨勫惎鍔ㄤ笌鍏抽棴</span></h1> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">1.1 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">紜JDK瀹夎閰嶇疆</span></h2> <p style="margin: 0cm 0cm 6pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍦ㄥ惎鍔↗BOSS鑺傜偣鍓嶏紝</span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">瑕佹紜?/span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">瀹夎SUN JDK1.5</span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">騫惰緗幆澧冨彉閲?JAVA_HOME</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">瑙e帇緙㎎BOOS-TGZ鍖?/font></span></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">1.2 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">榪愯JBOSS</span></h2> <p style="margin: 0cm 0cm 6pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">cd $JBOSS_HOME/bin</span></p> <p style="margin: 0cm 0cm 6pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">nohup ./run.sh -c </span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">vcom</span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> -b 0.0.0.0 </span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">–u 229.12.12.12</span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">&</span></p> <p style="margin: 0cm 0cm 6pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍙傛暟璇存槑錛?/span></p> <p style="margin: 0cm 0cm 6pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">-c: </span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鎸囧畾榪愯鐨勯厤緗紝default閰嶇疆涓嶅甫闆嗙兢鏀寔</span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">,all </span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍜岃嚜瀹氫箟鐨剉com鐩綍閰嶇疆甯︽湁闆嗙兢鏀寔鍔熻兘</span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">-b: </span><span style="line-height: 150%; font-family: 瀹嬩綋;">鎸囧畾鏈嶅姟緇戝畾鐨処P鍦板潃錛屽嵆瀵瑰鏈嶅姟鐨処P鍦板潃錛?.0.0.0琛ㄧず瀵規(guī)満鍣ㄤ笂鎵鏈夌殑IP鎻愪緵鏈嶅姟</span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">-u </span><span style="line-height: 150%; font-family: 瀹嬩綋;">鎸囧畾鏈嶅姟浣跨敤鐨刄DP緇勬挱鍦板潃</span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">1.3 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">鍏抽棴JBOSS鏈嶅姟</span></h2> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">緙栧啓鑴氭湰鍐呭濡備笅錛?/font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">#!/bin/bash</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">for i in ` ps -ef | grep -w java |grep -v grep |awk '{print $2 ""t"$3}'`;do kill -9 $i</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">done</font></span></p> <h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">2.jmx-console</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">鎺у埗鍙?/span></h1> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 浠垮畫_GB2312;"> </span><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;"> </span><span style="line-height: 150%; font-family: 瀹嬩綋;">瀹夎濂絡(luò)boss騫跺惎鍔╦boss鍚庯紝鍦ㄦ祻瑙堝櫒紿楀彛鐨勫湴鍧鏍忛噷閿叆 http://localhost:8080/jmx-console</span><span style="line-height: 150%; font-family: 瀹嬩綋;">錛坖boss榛樿鐨勭鍙e彿涓?080,鍙互鑷畾涔変慨鏀癸級銆?/span><span style="line-height: 150%; font-family: 瀹嬩綋;">灝卞彲浠ユ祻瑙?jboss鐨勯儴緗茬鐞嗙殑涓浜涗俊鎭紝榛樿鎯呭喌涓嬩笉閿叆浠諱綍鐢ㄦ埛鍚嶅拰瀵嗙爜灝卞彲浠ヨ繘鍏ユ欏甸潰錛屾柟渚挎槸鏂逛究錛屼絾鐪熸浣跨敤璧鋒潵榪樻槸鏈夌偣瀹夊叏闅愭?zhèn)eQ屽洜涓轟笉綆′換浣曚漢鍙鐭ラ亾server鐨刬p 閮藉彲浠ヨ繘鍘昏闂備笅闈㈡垜浠拡瀵規(guī)闂瀵筳boss榪涜閰嶇疆錛屼嬌寰楄闂甹mx-console涔熷繀欏?瑕佺煡閬撶敤鎴峰悕鍜屽瘑鐮佹墠鍙繘鍘昏闂? </span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><strong><span style="font-size: 15pt; line-height: 150%; font-family: 瀹嬩綋;"> 2.1 </span></strong><strong><span style="font-size: 15pt; line-height: 150%; font-family: 瀹嬩綋;">璁劇疆jmx-console瀹夊叏璁劇疆</span></strong></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;"> 1. </span><span style="line-height: 150%; font-family: 瀹嬩綋;">榪涘叆jmx-console.war錛岄氬父姝ょ洰褰曞湪$JBOSS_HOME/server/vcom/deploy鐩綍涓嬨?/span></font></p> <p style="margin: 0cm 0cm 0pt 5.25pt; text-indent: -5.25pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;"> 2. </span><span style="line-height: 150%; font-family: 瀹嬩綋;">緙栬緫璇ョ洰褰曚笅鐨?WEB-INF/web.xml錛屾妸<security-constraint>閮ㄥ垎娉ㄩ噴鍘繪帀 3.</span><span style="line-height: 150%; font-family: 瀹嬩綋;">緙栬緫$jboss_home/server/vcom/conf/props鐩綍涓嬬殑jmx-console-roles.properties鍜宩mx-console-users.properties錛?/span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">       1) users.properties</span><span style="line-height: 150%; font-family: 瀹嬩綋;">鏂囦歡閲屽畾涔夌敤鎴峰悕鍜屽瘑鐮侊紝鏍煎紡涓簎sername=password銆傚彲浠ヤ緷鐓ф鏍煎紡娣誨姞澶氫釜鐢ㄦ埛銆?</span></font></p> <p style="margin: 0cm 0cm 0pt; text-indent: 36.75pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">2) roles.propertie</span><span style="line-height: 150%; font-family: 瀹嬩綋;">鏂囦歡閲屽畾涔夌敤鎴峰悕鍜岃鑹詫紝鏍煎紡涓簎sername=role銆傝繖閲岀殑role蹇呴』鍜寃eb.xml鏂囦歡閲岀殑<role-name>鐩稿搴斻?</span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">4. </span><span style="line-height: 150%; font-family: 瀹嬩綋;">緙栬緫/WEB-INF/jboss-web.xml鏂囦歡錛屾墦寮<security-domain>閮ㄥ垎娉ㄩ噴錛涜繖閲?lt;security- domain>鍐呭瀵瑰簲鐨剆ecurity-domain瀵瑰簲$jboss_home"server"vcom"conf"login-config.xml榪欎釜jaas閰嶇疆鏂囦歡閲岀殑鏌愪釜application-policy銆?</span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">濡? </font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;"><security-domain>java:/jaas/jmx-console</security-domain> <br /> </span><span style="line-height: 150%; font-family: 瀹嬩綋;">鍦╨ogin-config.xml閲屽搴旀湁錛?/span></font></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"><application-policy name = "jmx-console"> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"><authentication> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"><login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" /> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"></authentication> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"></application-policy> </font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">5</span><span style="line-height: 150%; font-family: 瀹嬩綋;">錛庨噸鍚痡boss錛屽湪嫻忚鍣ㄤ腑閿叆鎺у埗鍙板湴鍧錛屽氨浼氬嚭鐜拌緭鍏sername鍜宲assword鐨勬彁紺虹獥鍙c?</span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">2.2 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">鐩戞帶闆嗙兢鐘跺喌鍜宻ession澶嶅埗鎯?/span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">鍐?/span></h2> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">浣跨敤<a href="http://localhost:8080/jmx-console"><font color="#0000ff">http://localhost:8080/jmx-console</font></a>,浣跨敤鍚嶄負jboss.cache:service=TomcatClustering MBean Members鍙互鏌ョ湅褰撳墠鏈虹兢鑺傜偣鎴愬憳淇℃伅錛屼嬌鐢╦boss.cache:service=TomcatClustering錛屽彲浠ョ湅鍒板綋鍓嶉泦緹ょ殑鑺傜偣ip,鍦╩ember 涓欏逛腑錛屽彲浠ヨ瀵熷埌褰撳墠闆嗙兢涓妭鐐筰p,濡傚浘錛?/font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><font size="3"><span style="font-family: 瀹嬩綋;">鍦ㄦ欏甸潰涓嬫壘鍒?/span><span style="font-family: 瀹嬩綋;">java.lang.String printDetails() </span><span style="font-family: 瀹嬩綋;">錛?/span></font></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><font size="3"><span style="font-family: 瀹嬩綋;">invoke the printDetails</span><span style="font-family: 瀹嬩綋;">鎿嶄綔錛岀偣鍑籭nvoke錛屽彲浠ュsession澶嶅埗榪涜鐩戞帶銆?/span></font></p> <h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">3</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">銆侀厤緗甁BOSS搴旂敤鏁版嵁搴撹繛鎺?/span></h1> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;">鐩墠搴旂敤浣跨敤鐨勬暟鎹簱榪炴帴鏄簲鐢ㄧ▼搴忚嚜甯︾殑JDBC 錛圓PI錛夋帴鍙o紝閰嶇疆濡備笅錛?/span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;">Cd /$JBOSS_HOME/server/vcom/deploy/*.war/WEB-INF/class/</span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;">Vi proxool.xml</span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 12pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;"> <</span><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">?xml version="1.0" encoding="UTF-8"?></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;"><datasource></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;"> <proxool></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <alias>pool</alias></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <driver-url>jdbc:oracle:thin:@192.168.104.32:1521:cportal</driver-url></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <driver-properties></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">      <property name="user" value="cportal"/></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">      <property name="password" value="cportal"/></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    </driver-properties></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <house-keeping-sleep-time>30000</house-keeping-sleep-time></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <minimum-connection-count>0</minimum-connection-count></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <maximum-connection-count>300</maximum-connection-count></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;">    <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;"> </proxool></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 9pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 9pt; line-height: 150%; font-family: 瀹嬩綋;"></datasource></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">(1) </span><span style="line-height: 150%; font-family: 瀹嬩綋;">jdbc:oracle:thin:@192.168.104.32:1521:cportal</span><span style="line-height: 150%; font-family: 瀹嬩綋;">錛宱racle鏈嶅姟绔彛鏄?521錛宑portal涓烘暟鎹簱鐨勫疄渚嬪悕鍗硈id銆?/span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">(2) </span><span style="line-height: 150%; font-family: 瀹嬩綋;"><property name="user" value="cportal"/></span></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><font face="瀹嬩綋"><span style="color: #333333;"> <property name="password" value="cportal"/> </span><span style="color: #333333; font-family: 瀹嬩綋;">涓烘暟鎹簱鐨勭敤鎴峰悕鍜屽瘑鐮?/span></font></font></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">錛?錛?/span><font face="瀹嬩綋"><maximum-connection-count>300</maximum-connection-count><span style="font-family: 瀹嬩綋;">涓哄鎴風(fēng)</span> </font><span style="font-family: 瀹嬩綋;">鏈澶х殑鏁版嵁搴撹繛鎺ユ暟</span></font></p> <h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">4.</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">淇敼jboss鏈嶅姟绔彛鍙?/span></h1> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">浣跨敤JBOSS涓棿浠舵椂,榛樿鐨勮闂鍙f槸8080錛屽彲浠ヤ慨鏀歸棶浣犳兂浣跨敤鐨勭鍙o紝淇敼姝ラ濡備笅錛?/font><br /> <font size="3">鎵撳紑JBOSS鐩綍$JBOSS_HOME/server/vcom/deploy/jboss-web.deployer/涓嬬殑server.xml鏂囦歡,鎼滅儲8080,灝?080鏀逛負鏂扮殑绔彛鍙?淇濆瓨鏂囦歡,閲嶅惎搴旂敤鏈嶅姟鍣ㄥ嵆鍙?璁塊棶鏃朵嬌鐢ㄦ柊鐨勭鍙e彿</font><font size="3">. <br /> <Connector port="80" address="${jboss.bind.address}"    </font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">         maxThreads="150" maxHttpHeaderSize="8192"</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">         emptySessionPath="true" protocol="HTTP/1.1"</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">         enableLookups="false" redirectPort="8443" acceptCount="100"</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">         connectionTimeout="20000" disableUploadTimeout="true" /></font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">鍏朵腑150鏄疛VM涓惎鍔ㄧ殑鏈澶х嚎紼嬫暟錛?00 涓篔VM杈懼埌鏈澶х嚎紼嬮榾鍊兼椂錛屽彲浠ユ斁鍦ㄩ槦鍒椾腑鐨凥TTP璇鋒眰鏁?/font></span></p> <h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">5.JBOSS</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">鏈嶅姟鐘舵佺洃鎺э紙web-console錛?/span></h1> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;"> </span><span style="line-height: 150%; font-family: 瀹嬩綋;">濡傛灉闇瑕佺洃鎺boss鐨勭郴緇熻祫婧愶紝濡傦細jboss鐨勫熀鏈厤緗儏鍐碉紝jvm鐨勫埄鐢ㄧ巼錛岀嚎紼嬫睜鐨勪嬌鐢ㄦ儏鍐碉紝鍙互浣跨敤web-console榪涜鐩戞帶銆?/span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 14pt; line-height: 173%; font-family: 瀹嬩綋;">5.1</span><span style="font-size: 14pt; line-height: 173%; font-family: 瀹嬩綋;">閰嶇疆web-console</span></h2> <p style="text-indent: 21pt;"><span style="font-size: 10.5pt;"><font face="瀹嬩綋">鍏蜂綋鏂規(guī)硶鍚宩mx-console錛屽氨鏄綅緗笉鍚岋紝鍏蜂綋鏂規(guī)硶鍙傝僯mx-console閰嶇疆錛?/font></span></p> <p style="margin: 0cm 0cm 0pt 47.25pt; text-indent: -18pt; text-align: left;" align="left"><span style="font-size: 10pt; font-family: Symbol;">· </span><font size="3"><span style="font-family: 瀹嬩綋;">jboss-web.xml</span><span style="font-family: 瀹嬩綋;">銆亀eb.xml鍦?JBOSS_HOME/vcom/deploy/management/console-mgr.sar/web-console.war/WEB-INF涓嬶紱</span></font></p> <p style="margin: 0cm 0cm 0pt 47.25pt; text-indent: -18pt; text-align: left;" align="left"><span style="font-size: 10pt; font-family: Symbol;">· </span><font size="3"><span style="font-family: 瀹嬩綋;">login-config.xml</span><span style="font-family: 瀹嬩綋;">榪樻槸鍘熸潵鐨勯偅涓紝鎶奱pplication-policy鍚嶄負$webConsoleDomain鐨勯儴鍒嗘敼鎴愪綘闇瑕佺殑web-console錛?/span></font></p> <p style="margin: 0cm 0cm 0pt 47.25pt; text-indent: -18pt; text-align: left;" align="left"><span style="font-size: 10pt; font-family: Symbol;">· </span><font size="3"><span style="font-family: 瀹嬩綋;">web-console-users.properties</span><span style="font-family: 瀹嬩綋;">銆亀eb-console-roles.properties瀹氫箟浜嗚闂?web-console鐨勭敤鎴楓佺敤鎴瘋鑹詫紝鍏蜂綋浣嶇疆鑷繁鍘繪壘錛屼嬌鐢╢ind /jboss -name web-console-users.properties 鎵懼埌浠ュ悗鍙互淇敼鐢ㄦ埛鍚嶃佸瘑鐮併?/span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 14pt; line-height: 173%; font-family: 瀹嬩綋;">5.2 </span><span style="font-size: 14pt; line-height: 173%; font-family: 瀹嬩綋;">鐩戞帶</span></h2> <p style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">浣跨敤http://localhost:8080/web-console/ 涓紝鑾峰彇褰撳墠JBOSS-WEB搴旂敤妯″潡鐨勮礋杞藉垎鎷呮儏鍐碉紝騫跺彲浠ユ煡鐪嬪埌褰撳墠JAVA铏氭嫙鏈虹殑鍐呭瓨浣跨敤鎯呭喌錛屽強綰跨▼姹犱嬌鐢ㄦ儏鍐點?/font></span></p> <p style="margin: 0cm -22.55pt 0pt 0cm; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">浣跨敤<a href="http://localhost:8080/web-console/status"><font color="#0000ff">http://localhost:8080/web-console/status</font></a>錛屽彲浠ヨ繘涓姝ョ洃鎺у埌姣忎釜綰跨▼鐨勭姸鎬併?/font></span></p> <h1 style="margin: 17pt 0cm 16.5pt;"><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">6.</span><span style="font-size: 16pt; line-height: 240%; font-family: 瀹嬩綋;">緋葷粺鏃ュ織鍒嗘瀽</span></h1> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">鍦?/span><span style="line-height: 150%; font-family: 瀹嬩綋;">$JBOSS_HOME /server/vcom/log</span><span style="line-height: 150%; font-family: 瀹嬩綋;">涓嬶紝鏈夊叧浜巎boss鐨勬棩蹇楄褰曪紝 鍏朵腑server.log鏄敤鏉ヨ褰旿BOOS榪愯榪囩▼鐨勬棩蹇楄褰?boot.log鐢ㄦ潵璁板綍JBOOS鍚姩淇℃伅鐨勶紝鍑虹幇闂鏃跺彲浠ラ氳繃sever.log瀵筳boss榪涜鍒嗘瀽銆?/span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;"> 6.1 JBOSS</span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">鐨勬棩蹇楅厤緗枃浠?/span></h2> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">$JBOSS_HOME /server/vcom/conf</span><span style="line-height: 150%; font-family: 瀹嬩綋;">涓嬬殑jboss-log4j.xml錛屽彲浠ュ鏃ュ織鐨勬潵婧愬拰綰у埆榪涜瀹氫箟錛屼篃鍙互瀹氫箟鏃ュ織鐨勮褰曟柟寮忋?/span></font></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">6.2 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">浜х敓cluster.log</span></h2> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">鍙互鎶妀boss-log4j.xml涓渶鍚庢湁鍏砪luster.log鐨凙PPENDER娉ㄩ噴鎺夛紝緋葷粺榪愯鏃朵細鍦╨og鐩綍涓嬩駭鐢焎luster.log鏂囦歡錛屽彲浠ラ氳繃姝ゆ枃浠跺闆嗙兢鏁呴殰榪涜鍒嗘瀽銆傚湪嫻嬭瘯璋冭瘯榪囩▼鍙互浣跨敤姝ゆ棩蹇?/font></span></p> <h2 style="margin: 13pt 0cm;"><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">6.3 </span><span style="font-size: 15pt; line-height: 173%; font-family: 瀹嬩綋;">鏇存敼鏃ュ織璁板綍鏂瑰紡</span></h2> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><font size="3"><span style="line-height: 150%; font-family: 瀹嬩綋;">Jboss</span><span style="line-height: 150%; font-family: 瀹嬩綋;">鏃ュ織璁板綍鏂瑰紡鏈?縐嶏細</span></font></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -36pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">1錛?/font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">              </span></span><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">鎸夋棩鏈熻繘琛岃褰?/font></span></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -36pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">2錛?/font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">              </span></span><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">鎸夋棩蹇楁枃浠剁殑澶у皬榪涜璁板綍</font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="line-height: 150%; font-family: 瀹嬩綋;"><font size="3">鐩墠浣跨敤鐨勬槸鎸夌収澶у皬淇℃伅璁板綍銆傚鏋滆淇敼璁板綍鏂瑰紡錛岀洿鎺ョ紪杈慾boss-log4j.xml鏂囦歡錛屽皢姝ゆ娉ㄩ噴鍘繪帀銆?/font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"><!-- A time/date based rolling appender --></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      <param name="File" value="${jboss.server.log.dir}/server.log"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      <param name="Append" value="false"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      <!-- Rollover at midnight each day --></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      <param name="DatePattern" value="'.'yyyy-MM-dd"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"> </font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      …………………………………………………</font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">……………………………………………………………………….</font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">      </layout></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">   </appender></font></span></p> <p style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: left;" align="left"><span style="font-size: 12pt; line-height: 150%; font-family: 瀹嬩綋;">鍚屾椂灝嗕笅孌墊敞閲婃帀</span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"><!-- A size based file rolling appender--></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender"></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     <param name="File" value="${jboss.server.log.dir}/server.log"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     <param name="Append" value="false"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     <param name="MaxFileSize" value="500KB"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     <param name="MaxBackupIndex" value="1"/></font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3"> ……………………………………………………………</font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">…………………………………………………………</font></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-family: 瀹嬩綋;"><font size="3">     </layout></font></span></p> <p style="margin: 0cm 0cm 0pt;"><font size="3"><span style="font-family: 瀹嬩綋;">   </appender></span></font></p> <font size="3"><span style="font-family: 瀹嬩綋;">涓嬨?/span></font> <img src ="http://www.tkk7.com/sealyu/aggbug/296024.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2009-09-22 14:48 <a href="http://www.tkk7.com/sealyu/archive/2009/09/22/296024.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Seam 欏圭洰閮ㄧ講鍦?tomcat 涓?杞?http://www.tkk7.com/sealyu/archive/2009/08/26/292632.htmlsealsealWed, 26 Aug 2009 04:36:00 GMThttp://www.tkk7.com/sealyu/archive/2009/08/26/292632.htmlhttp://www.tkk7.com/sealyu/comments/292632.htmlhttp://www.tkk7.com/sealyu/archive/2009/08/26/292632.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/292632.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/292632.html JBoss Tools 鐢熸垚鐨?nbsp;Seam 欏圭洰錛堟柊寤洪」鐩椂錛屾湇鍔″櫒閫夋嫨 tomcat錛夛紝浼氱敓鎴愪竴浜涘繀瑕佺殑鏂囦歡錛屽錛氳繛鎺ユ暟鎹簱鐨勬暟鎹簮鏂囦歡錛屽錛?/font>project-ds.xml 錛堜絾瀹冨彧鑳藉湪 Jboss as 鐨勭幆澧冧腑榪愯錛屼笉閫傜敤浜?nbsp;tomcat錛夛紝瑕佹兂寰堟垜浠殑欏圭洰錛?/font>war錛夎繍琛屼簬 tomcat 涓殑錛屾垜浠緱瀵瑰畠鑷姩鐢熸垚鐨勬枃浠跺仛涓浜涘繀瑕佺殑淇敼銆?/font>

      涓銆?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">淇敼鏁版嵁搴撶殑榪炴帴鏂瑰紡

         1銆侀噰鐢ㄦ暟鎹簮鐨勫艦寮?br />             鍦?nbsp;tomcat 涓厤緗暟鎹簮鏂瑰紡濡備笅:
            
鍦ㄧ敓鎴愮殑欏圭洰鍚岀駭鐩綍涓壘姝ゆ枃浠訛細 context.xml 
                     
Servers/Tomcat 銆傘傘?/font>/context.xml  浣滃涓嬮厤緗細
            
鍦ㄦ爣絳?nbsp;<Context> 涓棿鍔犲叆:
            <Resource  
                  
name="jdbc/demo" auth="Container" type="javax.sql.DataSource" 
                  
maxActive="30" maxIdle="5" maxWait="10000" username="root" 
                  
password="admindriverClassName="com.mysql.jdbc.Driver" 
                  
url="jdbc:mysql://localhost:3306/demo?useUnicode=true&amp;characterEncoding=UTF-8">

          </Resource>          

         2銆?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">浣跨敤闈炴暟鎹簮鐨勫艦寮?br />             鍦ㄦ枃浠訛細persistence.xml 涓坊鍔?/font>hibernate 鐨勮繛鎺ユ暟鎹簱鐨勬柟寮忥紝濡備笅錛?br />               <property name="hibernate.connection.username" value="root"/>
            
<property name="hibernate.connection.password" value="admin"/>
            
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
            <property name="hibernate.connection.url" 
                  
value="jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF-8"/>

      浜屻?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">淇敼 JPA 閰嶇疆鏂囦歡 persistence.xml

          1銆?/span>濡傛灉鏁版嵁鐨勮繛鎺ユ柟寮忛噰鐢ㄦ暟鎹簮鐨勫艦寮忥紝鍒欏彧闇淇敼閲岄潰鏁版嵁婧愮殑鍚嶇О錛屽錛?br />             <jta-data-source>java:comp/env/jdbc/demo</jta-data-source>

          2銆佸鏋滈噰鐢?font face="Times New Roman">hibernate 鐨勮繛鎺ユ柟寮忥紝鍒欐妸姝よ鍒犱簡銆?/font>        

          3銆?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">鍒犻櫎閲岄潰鐨勬琛岄厤緗細
             <property name="hibernate.transaction.manager_lookup_class" 
                  value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

          4銆佷慨鏀逛簨鍔$殑絳栫暐鏂瑰紡涓?RESOURCE_LOCAL 錛?nbsp;

            <persistence-unit name="demo" transaction-type="RESOURCE_LOCAL">

      涓夈?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">閰嶇疆 Seam 鐨勪簨鍔$鐞嗗櫒
          鍦?nbsp;component.xml 鏂囦歡鍔犲叆錛?br />           <transaction:entity-transaction entity-manager="#{entityManager}"/>
         榛樿鐢熸垚鐨勬鏂囦歡鏄笉鍚湁 transaction 鐨勫懡鍚嶇┖闂達紝闇瑕佹墜鍔ㄥ湪姝ゆ枃浠跺姞鍏ュ畠鐨勫懡鍚嶇┖闂達細

          xmlns:transaction=http://jboss.com/products/seam/transaction
         http://jboss.com/products/seam/transaction 
         http://jboss.com/products/seam/transaction-2.1.xsd

      鍥涖?span style="font-weight: normal; font-size: 10.5pt; font-family: '瀹嬩綋';">涓烘欏圭洰鍔犲叆蹇呰鐨勪緷璧栧寘 銆傘傘傘傘傘?/span>



seal 2009-08-26 12:36 鍙戣〃璇勮
]]>
JBoss涓殑TransactionTimeOut鐨勮緗?/title><link>http://www.tkk7.com/sealyu/archive/2009/05/18/271239.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Mon, 18 May 2009 02:01:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2009/05/18/271239.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/271239.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2009/05/18/271239.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/271239.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/271239.html</trackback:ping><description><![CDATA[榪欎袱澶╁湪浣渟eam鐨勬椂鍊欎笉鏃墮亣鍒?#8220;org.jboss.util.NestedSQLException: Transaction is not active”鐨勯敊璇俊鎭紝鍚庢潵鍒癹boss鐨剋iki涓婂彂鐜頒簡闂鐨勫師鍥犲拰瑙e喅鏂規(guī)硶錛?br /> <h2> How do I set the Transaction Timeout?</h2> <p>Transaction timeout (unit is always seconds) can be configured in various ways:</p> <p>This argument is the same no matter if you are using JBossTM(<=4.0.5) or JBossJTA-Arjuna(>=4.2).</p> <ul> <li type="ul"> <p>Globally: You can change this behavior globally by modifying the TransactionManagerService in /conf/jboss-service.xml (or /deploy/jta-service.xml for 4.0.3)</p> </li> </ul> <p><strong>Version <= 4.0.5</strong></p> <p>This part is the same for either JBossTM or JBossJTA and is the same for ejb2 and ejb3</p> <ul> <li type="ul"> <p>Per-method basis: Modifying the <span style="font-family: courier new,courier;"><transaction-timeout></span> element inside the <method> element of a session or entity bean. This is located in the META-INF/jboss.xml deployment descriptor of a session bean. When the transaction timeout is specified at the method level, it overrides the default timeout. Further information about this element can be found in jboss-x.x.x/docs/dtd/jboss_4_0.dtd. Example taken from the testsuite:</p> </li> </ul> <ul> <li type="ul"> <p>Using BMT: Calling javax.transaction.UserTransaction.setTransactionTimeout(int seconds). Please, be aware that this only applies to transactions started after this invocation on the same thread. Example:</p> </li> </ul> <pre><code jive-java="">@TransactionTimeout(1500)<br /> </code></pre> <br /> <br /> <img src ="http://www.tkk7.com/sealyu/aggbug/271239.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2009-05-18 10:01 <a href="http://www.tkk7.com/sealyu/archive/2009/05/18/271239.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.pathhttp://www.tkk7.com/sealyu/archive/2009/04/11/265054.htmlsealsealSat, 11 Apr 2009 14:22:00 GMThttp://www.tkk7.com/sealyu/archive/2009/04/11/265054.htmlhttp://www.tkk7.com/sealyu/comments/265054.htmlhttp://www.tkk7.com/sealyu/archive/2009/04/11/265054.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/265054.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/265054.html

P1:Tomcat6鍚姩鐨勬椂鍊欏嚭鐜頒笅闈㈣繖鏍風(fēng)殑鎻愮ず錛?/p>

2007-12-31 9:51:51 org.apache.catalina.core.AprLifecycleListener init
淇℃伅: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Sun\jre1.6.0_03\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;.;D:\Sun\jdk1.6.0_03\bin;D:\Sun\jdk1.6.0_03\jre\bin;D:\ApacheTomcat\lib;

S1:瀹為檯榪欐槸寤鴻浣跨敤apache鐨刟pr;apr 鏄痑pache portable runtime 鐢ㄤ笂榪欎釜鍚庡彲浠ユ湁鏁堢殑鎻愰珮tomcat澶勭悊闈欐侀〉闈㈢殑鑳藉姏.濡傛灉鎯充嬌鐢╝pr鐨勮瘽錛?瀹為檯鎿嶄綔寰堢畝鍗曪紝

涓嬭澆 http://tomcat.heanet.ie/native/1.1.1/binaries/win32/tcnative-1.dll

灝嗚繖涓枃浠跺鍒跺埌C:\WINDOWS\system32\涓嬮潰,鐒跺悗閲嶆柊鍚姩tomcat錛屽氨浼氬彂鐜皌omcat 鐨勬帶鍒跺彴淇℃伅涓猴細
2007-12-31 9:55:40 org.apache.catalina.core.AprLifecycleListener init
淇℃伅: An older version 1.1.8 of the Apache Tomcat Native library is installed, while Tomcat recommends version greater then 1.1.10
2007-12-31 9:55:40 org.apache.catalina.core.AprLifecycleListener init
淇℃伅: Loaded Apache Tomcat Native library 1.1.8.



seal 2009-04-11 22:22 鍙戣〃璇勮
]]>
JBoss綾誨姞杞介厤緗睘鎬?UseJBossWebLoaderhttp://www.tkk7.com/sealyu/archive/2009/02/24/256392.htmlsealsealTue, 24 Feb 2009 02:25:00 GMThttp://www.tkk7.com/sealyu/archive/2009/02/24/256392.htmlhttp://www.tkk7.com/sealyu/comments/256392.htmlhttp://www.tkk7.com/sealyu/archive/2009/02/24/256392.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/256392.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/256392.htmlSee ClassLoadingConfiguration.

Available option in deploy/jbossweb-tomcat.sar/META-INF/jboss-service.xml

or deploy/jboss-web.deployer/META-INF/jboss-service.xml

This configuration options toggles usage of separate classloaders for web modules. The JBoss unified classloader holds all the classes from multiple web applications in one big classloader and may cause unwanted interference.

Example

Imagine web modules "sales.war" and "stock.war", both containing some version of "utility.jar". In case "sales.war" uses version 1.0 and "stock.war" requires version 2.0, turning off the unified web loader is the safest solution. If you don't, the first loaded library will have priority, and remains in the classloader till the reference count drops to zero.

The disadvantage of using isolated classloaders: either you need to duplicate the same library across multiple web modules, or add it to the classpath of your server instance (default: lib/). The instance libraries are defaults, they can be overridden when the web module contains it's own custom versions.

The configuration file contains a small comment about isolation of JSP files as well, to separate two JSP files with the same name from two different web modules. In JBoss 4.0.5, using non-precompiled JSP pages, this seems to work fine, even with the JBoss unified web loader.



seal 2009-02-24 10:25 鍙戣〃璇勮
]]>
How to use Django with Apache and mod_pythonhttp://www.tkk7.com/sealyu/archive/2008/11/07/239347.htmlsealsealFri, 07 Nov 2008 15:44:00 GMThttp://www.tkk7.com/sealyu/archive/2008/11/07/239347.htmlhttp://www.tkk7.com/sealyu/comments/239347.htmlhttp://www.tkk7.com/sealyu/archive/2008/11/07/239347.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/239347.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/239347.htmlApache with mod_python currently is the preferred setup for using Django on a production server.

mod_python is similar to (and inspired by) mod_perl : It embeds Python within Apache and loads Python code into memory when the server starts. Code stays in memory throughout the life of an Apache process, which leads to significant performance gains over other server arrangements.

Django requires Apache 2.x and mod_python 3.x, and you should use Apache’s prefork MPM, as opposed to the worker MPM.

You may also be interested in How to use Django with FastCGI, SCGI or AJP (which also covers SCGI and AJP).

Basic configuration

To configure Django with mod_python, first make sure you have Apache installed, with the mod_python module activated.

Then edit your httpd.conf file and add the following:

<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
</Location>

...and replace mysite.settings with the Python import path to your Django project's settings file.

This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the Django mod_python handler." It passes the value of DJANGO_SETTINGS_MODULE so mod_python knows which settings to use.

New in Django 1.0: The PythonOption django.root ... is new in this version.

Because mod_python does not know we are serving this site from underneath the /mysite/ prefix, this value needs to be passed through to the mod_python handler in Django, via the PythonOption django.root ... line. The value set on that line (the last item) should match the string given in the <Location ...> directive. The effect of this is that Django will automatically strip the /mysite string from the front of any URLs before matching them against your URLConf patterns. If you later move your site to live under /mysite2, you will not have to change anything except the django.root option in the config file.

When using django.root you should make sure that what's left, after the prefix has been removed, begins with a slash. Your URLConf patterns that are expecting an initial slash will then work correctly. In the above example, since we want to send things like /mysite/admin/ to /admin/, we need to remove the string /mysite from the beginning, so that is the django.root value. It would be an error to use /mysite/ (with a trailing slash) in this case.

Note that we're using the <Location> directive, not the <Directory> directive. The latter is used for pointing at places on your filesystem, whereas <Location> points at places in the URL structure of a Web site. <Directory> would be meaningless here.

Also, if your Django project is not on the default PYTHONPATH for your computer, you'll have to tell mod_python where your project can be found:

<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
PythonPath "['/path/to/project'] + sys.path"
</Location>

The value you use for PythonPath should include the parent directories of all the modules you are going to import in your application. It should also include the parent directory of the DJANGO_SETTINGS_MODULE location. This is exactly the same situation as setting the Python path for interactive usage. Whenever you try to import something, Python will run through all the directories in sys.path in turn, from first to last, and try to import from each directory until one succeeds.

An example might make this clearer. Suppose you have some applications under /usr/local/django-apps/ (for example, /usr/local/django-apps/weblog/ and so forth), your settings file is at /var/www/mysite/settings.py and you have specified DJANGO_SETTINGS_MODULE as in the above example. In this case, you would need to write your PythonPath directive as:

PythonPath "['/usr/local/django-apps/', '/var/www'] + sys.path"

With this path, import weblog and import mysite.settings will both work. If you had import blogroll in your code somewhere and blogroll lived under the weblog/ directory, you would also need to add /usr/local/django-apps/weblog/ to your PythonPath. Remember: the parent directories of anything you import directly must be on the Python path.

Note

If you're using Windows, we still recommended that you use forward slashes in the pathnames, even though Windows normally uses the backslash character as its native separator. Apache knows how to convert from the forward slash format to the native format, so this approach is portable and easier to read. (It avoids tricky problems with having to double-escape backslashes.)

This is valid even on a Windows system:

PythonPath "['c:/path/to/project'] + sys.path"

You can also add directives such as PythonAutoReload Off for performance. See the mod_python documentation for a full list of options.

Note that you should set PythonDebug Off on a production server. If you leave PythonDebug On, your users would see ugly (and revealing) Python tracebacks if something goes wrong within mod_python.

Restart Apache, and any request to /mysite/ or below will be served by Django. Note that Django's URLconfs won't trim the "/mysite/" -- they get passed the full URL.

When deploying Django sites on mod_python, you'll need to restart Apache each time you make changes to your Python code.

Multiple Django installations on the same Apache

It's entirely possible to run multiple Django installations on the same Apache instance. Just use VirtualHost for that, like so:

NameVirtualHost *

<VirtualHost *>
ServerName www.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
</VirtualHost>

<VirtualHost *>
ServerName www2.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
</VirtualHost>

If you need to put two Django installations within the same VirtualHost (or in different VirtualHost blocks that share the same server name), you'll need to take a special precaution to ensure mod_python's cache doesn't mess things up. Use the PythonInterpreter directive to give different <Location> directives separate interpreters:

<VirtualHost *>
ServerName www.example.com
# ...
<Location "/something">
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonInterpreter mysite
</Location>

<Location "/otherthing">
SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
PythonInterpreter othersite
</Location>
</VirtualHost>

The values of PythonInterpreter don't really matter, as long as they're different between the two Location blocks.

Running a development server with mod_python

If you use mod_python for your development server, you can avoid the hassle of having to restart the server each time you make code changes. Just set MaxRequestsPerChild 1 in your httpd.conf file to force Apache to reload everything for each request. But don't do that on a production server, or we'll revoke your Django privileges.

If you're the type of programmer who debugs using scattered print statements, note that print statements have no effect in mod_python; they don't appear in the Apache log, as one might expect. If you have the need to print debugging information in a mod_python setup, either do this:

assert False, the_value_i_want_to_see

Or add the debugging information to the template of your page.

Serving media files

Django doesn't serve media files itself; it leaves that job to whichever Web server you choose.

We recommend using a separate Web server -- i.e., one that's not also running Django -- for serving media. Here are some good choices:

If, however, you have no option but to serve media files on the same Apache VirtualHost as Django, here's how you can turn off mod_python for a particular part of the site:

<Location "/media">
SetHandler None
</Location>

Just change Location to the root URL of your media files. You can also use <LocationMatch> to match a regular expression.

This example sets up Django at the site root but explicitly disables Django for the media subdirectory and any URL that ends with .jpg, .gif or .png:

<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
</Location>

<Location "/media">
SetHandler None
</Location>

<LocationMatch "".(jpg|gif|png)$">
SetHandler None
</LocationMatch>

Serving the admin files

Note that the Django development server automagically serves admin media files, but this is not the case when you use any other server arrangement. You're responsible for setting up Apache, or whichever media server you're using, to serve the admin files.

The admin files live in (django/contrib/admin/media) of the Django distribution.

Here are two recommended approaches:

  1. Create a symbolic link to the admin media files from within your document root. This way, all of your Django-related files -- code and templates -- stay in one place, and you'll still be able to svn update your code to get the latest admin templates, if they change.
  2. Or, copy the admin media files so that they live within your Apache document root.

Using "eggs" with mod_python

If you installed Django from a Python egg or are using eggs in your Django project, some extra configuration is required. Create an extra file in your project (or somewhere else) that contains something like the following:

import os
os.environ['PYTHON_EGG_CACHE'] = '/some/directory'

Here, /some/directory is a directory that the Apache webserver process can write to. It will be used as the location for any unpacking of code the eggs need to do.

Then you have to tell mod_python to import this file before doing anything else. This is done using the PythonImport directive to mod_python. You need to ensure that you have specified the PythonInterpreter directive to mod_python as described above (you need to do this even if you aren't serving multiple installations in this case). Then add the PythonImport line in the main server configuration (i.e., outside the Location or VirtualHost sections). For example:

PythonInterpreter my_django
PythonImport /path/to/my/project/file.py my_django

Note that you can use an absolute path here (or a normal dotted import path), as described in the mod_python manual. We use an absolute path in the above example because if any Python path modifications are required to access your project, they will not have been done at the time the PythonImport line is processed.

Error handling

When you use Apache/mod_python, errors will be caught by Django -- in other words, they won't propagate to the Apache level and won't appear in the Apache error_log.

The exception for this is if something is really wonky in your Django setup. In that case, you'll see an "Internal Server Error" page in your browser and the full Python traceback in your Apache error_log file. The error_log traceback is spread over multiple lines. (Yes, this is ugly and rather hard to read, but it's how mod_python does things.)

If you get a segmentation fault

If Apache causes a segmentation fault, there are two probable causes, neither of which has to do with Django itself.

  1. It may be because your Python code is importing the "pyexpat" module, which may conflict with the version embedded in Apache. For full information, see Expat Causing Apache Crash.
  2. It may be because you're running mod_python and mod_php in the same Apache instance, with MySQL as your database backend. In some cases, this causes a known mod_python issue due to version conflicts in PHP and the Python MySQL backend. There's full information in the mod_python FAQ entry.

If you continue to have problems setting up mod_python, a good thing to do is get a barebones mod_python site working, without the Django framework. This is an easy way to isolate mod_python-specific problems. Getting mod_python Working details this procedure.

The next step should be to edit your test code and add an import of any Django-specific code you're using -- your views, your models, your URLconf, your RSS configuration, etc. Put these imports in your test handler function and access your test URL in a browser. If this causes a crash, you've confirmed it's the importing of Django code that causes the problem. Gradually reduce the set of imports until it stops crashing, so as to find the specific module that causes the problem. Drop down further into modules and look into their imports, as necessary.



seal 2008-11-07 23:44 鍙戣〃璇勮
]]>
Apache + Tomcat 閰嶇疆澶氫釜搴旂敤http://www.tkk7.com/sealyu/archive/2008/08/25/224326.htmlsealsealMon, 25 Aug 2008 15:14:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/25/224326.htmlhttp://www.tkk7.com/sealyu/comments/224326.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/25/224326.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/224326.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/224326.html 鍒氬紑濮嬪湪鍚屼竴涓猼omcat涓厤緗簡澶氫釜搴旂敤錛屽悗鏉ユ劅瑙夋晥鏋滀笉濂斤紝鏀逛負姣忎釜tomcat瀵瑰簲涓涓簲鐢ㄣ傛悳绱㈣祫鏂欏涓嬶細
apache2.2涓巘omcat闆嗘垚(鍙互澶氫釜tomcat)
1. 瀹夎apache2.2 鍙傝錛?a target="_blank">http://ttitfly.javaeye.com/admin/show/127337

2.闇姹傛鍐碉細
鏈?涓湇鍔★細www.test.com, bbs.test.com銆傚垎鍒搴?涓猼omcat涓嬬殑2涓獁eb搴旂敤銆傜敱apache httpd浣滀負浜掕仈緗戞帴鍏ユ湇鍔″櫒錛屽湪80绔彛鎺ユ敹瀵硅繖2涓湇鍔$殑璇鋒眰銆?span class="hilite1">apache httpd鍐嶅皢榪?涓姹傚垎鍒搴斿埌涓嶅悓鐨勫悗绔痺eb鏈嶅姟鍣?Tomcat)澶勭悊銆?

3.閰嶇疆鍩熷悕鏄犲皠鍒版湰鏈哄嵆127.0.0.1錛屽悓鏃墮厤緗畇ervice鍩熷悕

  1. 127.0.0.1    localhost www.test.com www.service.test.com bbs.test.com bbs.service.test.com  


4. 鍒嗗埆鍦?涓猼omcat閲屽垎鍒儴緗蹭竴涓潪甯哥畝鍗曠殑搴旂敤銆?

絎竴涓猼omcat 錛氱鍙?8080

緙栬緫$TOMCAT_HOME/conf/server.xml

娣誨姞涓涓狧ost
<Host name="www.service.test.com" unpackWARs="true" autoDeploy="true"  
  1. xmlValidation="false" xmlNamespaceAware="false"/>  


鍐嶅湪$TOMCAT_HOME/conf/Catalina涓嬪緩绔嬩竴涓洰褰?www.service.test.com
鐒跺悗鍦╳ww.service.test.com鐩綍涓嬪緩绔嬩竴涓猂OOT.xml,鍐呭涓猴細
 
  1. <Context docBase="/home/mahaibo/app/test"  
  2. privileged="true" antiResourceLocking="false" antiJARLocking="false">   
  3. </Context>  

docBase鎸囧悜鍏蜂綋鐨勯」鐩礬寰?/span>

鍚岀悊絎簩涓猼omcat錛堢鍙?088錛変篃鏄竴鏍風(fēng)殑鍋氭硶錛?

緙栬緫$TOMCAT_HOME/conf/server.xml

娣誨姞涓涓狧ost:
 
  1. <Host name="bbs.service.test.com" unpackWARs="true" autoDeploy="true"  
  2. xmlValidation="false" xmlNamespaceAware="false"/>  



鐒跺悗鍦?TOMCAT_HOME/conf/Catalina涓嬪緩绔嬩竴涓洰褰?bbs.service.test.com

鍐嶅湪bbs.service.test.com鐩綍涓嬪緩绔嬩竴涓猂OOT.xml,鍐呭涓猴細
 
  1. <Context docBase="/home/mahaibo/app/bbs"  
  2. privileged="true" antiResourceLocking="false" antiJARLocking="false">   
  3. </Context>  


5. 鍒嗗埆鍚姩tomcat錛屽彲浠ラ氳繃http://www.service.test.com:8080鍜宧ttp://bbs.service.test.com:8088璁塊棶

6. 閰嶇疆apache httpd.conf鏂囦歡銆?

鎵懼埌apach/conf/httpd.conf鏂囦歡錛岀‘璁や笅闈㈣繖浜涙枃瀛楄鍓嶉潰娌℃湁"#"娉ㄩ噴鍙鳳細

 
  1. LoadModule proxy_module modules/mod_proxy.so   
  2. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so   
  3. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so   
  4. LoadModule proxy_connect_module modules/mod_proxy_connect.so   
  5. LoadModule proxy_http_module modules/mod_proxy_http.so   
  6. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so  


騫跺鍔犺櫄鎷熶富鏈洪厤緗細
 
  1. NameVirtualHost *:80  
  2. <VirtualHost *:80>   
  3. ServerName www.test.com   
  4. ProxyIOBufferSize 8192  
  5. ProxyRequests Off   
  6. ProxyVia Full   
  7. ProxyPass / http://www.service.test.com:8080/ smax=5 max=20 ttl=120 retry=300   
  8. </VirtualHost>   
  9.   
  10. <VirtualHost *:80>   
  11. ServerName bbs.test.com   
  12. ProxyIOBufferSize 8192  
  13. ProxyRequests Off   
  14. ProxyVia Full   
  15. ProxyPass / http://bbs.service.test.com:8088/ smax=5 max=20 ttl=120 retry=300   
  16. </VirtualHost>  


7.鍚姩apache
 
  1. ./<SPAN class=hilite1>apache</SPAN>ctl start  



8 鍙互閫氳繃璁塊棶http://www.test.com鍜宧ttp://bbs.test.com鏉ュ垎鍒闂?涓笉鍚宼omcat涓嬬殑涓嶅悓搴旂敤浜嗐?br />  



apache+tomcat閰嶇疆璐熻澆鍧囪 鐨勭綉绔?

1.   鐩爣

浣跨敤 apache 鍜?/span> tomcat 閰嶇疆涓涓彲浠ュ簲鐢ㄧ殑 web 緗戠珯錛岃杈懼埌浠ヤ笅瑕佹眰錛?/span>

1銆?nbsp;Apache 鍋氫負 HttpServer 錛屽悗闈㈣繛鎺ュ涓?/span> tomcat 搴旂敤瀹炰緥錛屽茍榪涜璐熻澆鍧囪 銆?/span>

2銆?nbsp;涓虹郴緇熻瀹?/span> Session 瓚呮椂鏃墮棿錛屽寘鎷?/span> Apache 鍜?/span> tomcat

3銆?nbsp;涓虹郴緇熷睆钄芥枃浠跺垪琛紝鍖呮嫭 Apache 鍜?/span> tomcat

2.   瀹夎 tomcat

2.1. 涓嬭澆錛岃В鍘?/span> tomcat

涓嶈涓嬭澆瀹夎鐗?/span> , 涓嬭澆鍦板潃

http://tomcat.apache.org

2.2. 閰嶇疆 tomcat

2.2.1.     閰嶇疆 server 鐨勫叧闂彛

鎴戜滑闇瑕佸湪涓鍙版満鍣ㄤ笂璺?/span> 2 涓笉鍚岀殑 tomcat 錛岄渶瑕佷慨鏀逛笉鍚岀殑 tomcat 鐨勫叧闂彛錛岄伩鍏嶅嚭鐜扮鍙h鍗犵敤鐨勬儏鍐點傚湪 server.xml 涓壘鍒?/span> server, 灝嗭細

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

鏀逛負

<Server port="XXXX" shutdown="SHUTDOWN">

XXXX 鍦ㄨ繖閲岃〃紺轟笉鍚岀殑绔彛錛氭垜鐨勪袱涓?/span> tomcat 鍒嗗埆浣跨敤 8035 錛?/span> 8045

娉ㄦ剰錛氳繖閲屼箣鎵浠ヨ閰嶇疆涓嶅悓鐨?/span> tomcat 鍏抽棴鍙o紝鍙槸鍥犱負鎴戜滑浣跨敤浜嗗涓?/span> tomcat 錛屽叾瀹炵敤涓涓?/span> server 澶氫釜瀹炰緥涔熷彲浠ャ?/span>

2.2.2.     閰嶇疆 service

鎴戜滑闇瑕佸涓嶅悓鐨?/span> tomcat 鐨?/span> service 鍙栦笉鍚岀殑鍚嶅瓧錛屽湪 server.xml 涓壘鍒幫細

<Service name="Catalina">

鏀逛負錛?/span>

<Service name="XXXX">

涓や釜 service 鍒嗗埆涓?/span> tomcat6 鍜?/span> tomcat5

2.2.3.     閰嶇疆 Connector

榪欎釜閮ㄥ垎涓昏鏄鏀逛袱涓?/span> Connector 錛屽綋鐒跺墠鎻愭槸浣犵殑 tomcat 鍙湁涓や釜 Connector 銆?/span>

淇敼 ajp1.3 鐨勭鍙o細

鎵懼埌錛?/span> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

鏀逛負錛?/span> <Connector port="XXXX" protocol="AJP/1.3" redirectPort="8443" />

涓や釜 Service 鐨?/span> ajp/1.3 鐨勭鍙e垎鍒負錛?/span> 8019 錛?/span> 8029

淇敼 http 鐨勭鍙o細

鎵懼埌錛?/span>

<Connector port="8080" protocol="HTTP/1.1"

               maxThreads="150" connectionTimeout="20000"

               redirectPort="8443" />

鏀逛負錛?/span>

<Connector port="XXXX" protocol="HTTP/1.1"

               maxThreads="150" connectionTimeout="20000"

               redirectPort="8443" />

涓や釜 Service 鐨?/span> ajp/1.3 鐨勭鍙e垎鍒負錛?/span> 8060 錛?/span> 8070

2.2.4.     閰嶇疆 Engine

Engine 涓昏鏄厤緗?/span> jvmRoute 灞炴э紝鎵懼埌錛?/span>

<Engine name="Catalina" defaultHost="localhost">

鏀逛負錛?/span>

<Engine jvmRoute="XXXX" name="Catalina" defaultHost="localhost">

涓や釜瀹炰緥鍒嗗埆涓猴細 tomcat6 鍜?/span> tomcat5.

2.2.5.     閰嶇疆鍏敤鎬?/span> Context

濡傛灉鏈?/span> Context 鏄涓郴緇熷叕鐢ㄧ殑錛屾瘮濡傚浘鐗囩瓑鐨勫瓨鏀懼湴錛屽彲浠ュ仛涓厤緗細

鍦?/span> Host 涓鍔狅細

<Context path="/image" docBase="D:"webRoot"image" debug="0" reloadable="false" crossContext="true">

</Context>

2.2.6.     灞忚斀鏂囦歡鍒楄〃

鎵撳紑 tomcat 鐩綍涓嬬殑 conf/web.xml 錛?/span>

鎵懼埌錛?/span>

<servlet>

        <servlet-name>default</servlet-name>

        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>

        <init-param>

            <param-name>debug</param-name>

            <param-value>0</param-value>

        </init-param>

        <init-param>

            <param-name>listings</param-name>

            <param-value>true</param-value>

        </init-param>

        <load-on-startup>1</load-on-startup>

    </servlet>

灝?/span> listings 鍙傛暟鏀逛負 false;

2.3. 閰嶇疆搴旂敤 (web.xml)

瀵圭郴緇熷簲鐢ㄥ仛浜涙帶鍒躲?/span>

閰嶇疆 session 榪囨湡鏃墮棿錛屽ぇ澶氭暟緗戠珯鐢ㄦ埛閮藉彧鏄仛浜涙祻瑙堟х殑鎿嶄綔錛屼負浜嗗噺杞繪湇鍔″櫒璐熻澆鍘嬪姏錛屾垜浠皢 session 瓚呮椂鏃墮棿浠庨粯璁ょ殑 30 鍒嗛挓鍙樹負 5 鍒嗛挓銆?/span>

鍦?/span> web 搴旂敤紼嬪簭鐨?/span> web.xml 涓?/span> servlet-mapping 涔嬪悗澧炲姞濡備笅涓孌碉細

<session-config>

    <session-timeout>5</session-timeout>

</session-config>

3.   瀹夎 Apache

3.1. 涓嬭澆銆佸畨瑁?/span> Apache

涓嬭澆鍦板潃 http://httpd.apache.org/download.cgi

涓嬭澆鍚庣偣鍑誨畨瑁?/span> msi 鏂囦歡銆?/span>

瀹夎鐨勬椂鍊欐病鏈変粈涔堢壒鍒渶瑕佹敞鎰忕殑鍦版柟錛屾寜鐓ч粯璁ゅ氨琛屼簡銆傛槸鍚﹀畨瑁呬負 service 鐪嬪叿浣撴儏鍐佃屽畾銆?/span>

3.2. 涓嬭澆銆佸畨瑁?/span> Apache 銆?/span> tomcat 鐨?/span> Connector

http://tomcat.apache.org/download-connectors.cgi

娉ㄦ剰錛屽緢澶氱綉绔欎笂閮戒粙緇嶆槸 JK2 錛屽彲鑳芥槸瑙夊緱 JK2 姣?/span> JK 瑕佹柊鍚э紝鍏跺疄 JK2 宸茬粡鍋滄鐮斿彂浜嗭紝寤鴻浣跨敤 jk1.2 銆?/span>

涓嬭澆鍘嬬緝鍖咃紝涔嬪悗灝?/span> module 鐩綍涓殑 mod_jk-apache****.so 鏂囦歡鏀懼叆 /module/ 鐩綍涓嬨?/span>

3.3. 閰嶇疆 Apache 錛?/span> httpd.conf 錛?/span>

3.3.1.     閰嶇疆绔彛錛?

鎵懼埌

Listen 80

鏀逛負

Listen **

褰撶劧濡傛灉涓嶉渶瑕佹敼鐨勮瘽錛屽氨涓嶇敤鏀逛簡銆傛甯告儏鍐墊棤欏繪洿鏀廣?/span>

3.3.2.     閰嶇疆 DocumentRoot

鎵懼埌 DocumentRoot 孌碉紝灝嗗叾鏀逛負錛?/span>

DocumentRoot "E:/MyWebsite"

榪欓噷鐨?/span> "E:/MyWebsite" 鎸囩殑鏄綘鐨?/span> web 紼嬪簭鐨勬牴璺緞錛岃鍏蜂綋搴旂敤鑰屽畾銆?/span>

3.3.3.     閰嶇疆 serverName

鎵懼埌 serverName 榪欎釜孌碉紝灝嗗叾閰嶇疆涓轟綘鐨?/span> ServerName

濡傛灉娌℃湁閰嶇疆涓哄煙鍚嶏紝閰嶄負 IP 涔熷彲浠ワ紝姝ゅ榪樹笉鏄緢娓呮錛屽铏氭嫙涓繪満鐨勬儏鍐電殑閰嶇疆銆?/span>

3.3.4.     閰嶇疆铏氭嫙涓繪満

<VirtualHost *:80>

    ServerAdmin flyffa@gmail.com

    DocumentRoot       E:/MyWebsite

    ServerName localhost

    DirectoryIndex index.html index.htm index.jsp

    ErrorLog logs/error_log

    CustomLog logs/access_log common

    ErrorDocument 404 /sys/logon.jsp

</VirtualHost>

3.4. 閰嶇疆 JK 鏂瑰紡鐨勮礋杞藉潎琛?/span>

3.4.1.     閰嶇疆 module

鎴戜滑闇瑕佷笌 tomcat 鍋氳繛鎺ワ紝鎵浠ヨ鎶?/span> tomcat 鐨?/span> connector 鐨勬ā鍧楅厤緗繘鍘匯?/span>

鍦?/span> LoadModule 閮ㄥ垎鍔犲叆錛?/span>

LoadModule jk_module modules/mod_jk-apache-2.0.55.so 錛嶅姞杞芥ā鍧?/span>

榪欎釜 so 鏄垜涓嬭澆鐨勭増鏈紝涓漢鍙互鏍規(guī)嵁鑷繁涓嬭澆鐨勬枃浠跺悕鍔犱互閰嶇疆

JkWorkersFile conf/workers.properties 錛嶆寚瀹?/span> connector 鐨勯厤緗枃浠跺悕縐?/span>

JkLogFile logs/mod_jk.log 錛嶆寚瀹?/span> connector 鐨勬棩蹇楁枃浠跺悕縐?/span>

JkLogLevel info 錛嶆寚瀹?/span> connector 鐨勬棩蹇楃瓑綰?/span>

3.4.2.     閰嶇疆 worker 鍒楄〃 (conf/workers.properties)

瀹氫箟鍒楄〃

worker.list=tomcat6,tomcat5,loadbalancer

瀹氫箟涓涓悕涓?/span> “loadbalancer” 鐨?/span> worker

鍏朵綔涓哄澶氫釜 Tomcat 榪涚▼鐨勮礋杞藉鉤琛′嬌鐢細

worker.loadbalancer.type=lb

worker.loadbalancer.balanced_workers=tomcat5, tomcat6

錛?/span> 璐熻澆騫寵 綾誨瀷鐨?/span> worker 騫朵笉涓?/span> Tomcat worker 閫氳錛屽畠璐熻矗綆$悊榪欎簺 Tomcat worker 銆?/span> 錛?/span>

瀹氫箟澶氫釜 worker 鍒楄〃

# Set properties for tomcat6 (ajp13)

worker.tomcat6.type=ajp13

worker.tomcat6.host=localhost

worker.tomcat6.port=8019

worker.tomcat6.lbfactor=50

worker.tomcat6.cachesize=10

worker.tomcat6.cache_timeout=600

worker.tomcat6.socket_keepalive=1

worker.tomcat6.reclycle_timeout=300

# Set properties for tomcat5 (ajp13)

worker.tomcat5.type=ajp13

worker.tomcat5.host=localhost

worker.tomcat5.port=8029

worker.tomcat5.lbfactor=50

worker.tomcat5.cachesize=10

worker.tomcat5.cache_timeout=600

worker.tomcat5.socket_keepalive=1

worker.tomcat5.reclycle_timeout=300

娉ㄦ剰錛?/span> lbfactor= 50 錛?/span> 褰撴 Tomcat worker 琚敤浜庝竴涓礋杞藉鉤琛?/span> worker 浣跨敤鏃訛紝姝ゅ睘鎬у皢琚嬌鐢ㄣ傚畠瀹氫箟浜嗘 worker 鐨勮礋杞藉鉤琛℃潈鍊箋?/span> 錛?/span>

cachesize= 10 錛?/span> 褰撳湪澶氱嚎紼嬬殑 web server 錛堜緥濡?/span> apache2.0 銆?/span> IIS 銆?/span> Netscape 錛変腑浣跨敤 JK 鏃訛紝姝ゅ睘鎬ф槸鏈夋晥鐨勩傚鏋滃皢 cachesize 鐨勫艱緗負杈冮珮鐨勫鹼紝榪欎簺鏀寔澶氱嚎紼嬬殑 web server 灝嗚幏寰楀緢濂界殑澶勭悊鑳藉姏銆傚鏋滄灞炴т笉琚緗紝鍒欒繛鎺?/span> cache 鐗規(guī)у皢澶辨晥銆?/span> 錛?/span>

3.4.3.     閰嶇疆 Apache 鍒?/span> tomcat 鐨勬ˉ鎺?/span>

鍦?/span> DocumnetRoot 鐗囨涓嬪姞鍏?/span>

JkMount /*.jsp tomcat6

JkMount /*.do tomcat6

JkMount /*Servlet tomcat6

榪欓噷鍙槸綆鍗曠殑灝?/span> apache 鐨勮姹傝漿鍒板叾涓殑涓涓?/span> tomcat 涓紝褰㈡垚妗ユ帴錛岃嚦浜庤礋杞藉潎琛$殑鏃跺欙紝灝辨棤欏昏繘琛岃繖姝ユ搷浣滐紝鐩存帴鍚姩璐熻澆鍧囪 銆傚惎鍔ㄨ礋杞藉潎琛¤涓嬩竴鑺傘?/span>

3.4.4.     鍚姩璐熻澆鍧囪 

鍦?/span> DocumnetRoot 鐗囨涓嬪姞鍏?/span>

JkMount /*.jsp loadbalancer

JkMount /*.do loadbalancer

JkMount /*Servlet loadbalancer

錛嶆寚瀹氬鎵鏈夌殑璇鋒眰鍚姩璐熻澆鍧囪 錛岃繖閲岀殑 loadbalancer 鏄?span style="color: #ff6600">瀹氫箟鐨?/span> worker 鐨勫悕瀛?/span>

榪欓噷鎴戝湪閰嶇疆鐨勬椂鍊欑姱浜嗕袱涓敊璇細

絎竴鏄病鏈夐厤緗?/span> JkWorkersFile conf/workers.properties 錛屼互涓?/span> Apache 浼氳嚜鍔ㄨ璇嗭紙鍏跺疄 apache 鏄嚜鍔ㄤ駭鐢熶簡涓涓彨鍋?/span> ajp13 鐨?/span> worker 錛屾寚鍚戞湰鏈虹殑 8009 绔彛錛夈?/span>

絎簩鏄互涓?/span> JkMount 璇彞涓嚭鐜?/span> loadbalancer,ajp13 涔嬬被鐨勬槸緋葷粺璁懼畾鐨勪笢瑗匡紝鍏跺疄閮芥槸鍦?/span> workers.properties 鏂囦歡涓畾涔夌殑錛岀粨鏋滃嚭鐜板悕瀛椾笉鍖歸厤鐨勬儏鍐點傚悗鏉ラ厤緗簡 JkLogFile logs/mod_jk.log 涔嬪悗鐪嬪埌閿欒鏃ュ織鎵嶆槑鐧姐?/span>

3.5. 閰嶇疆 Proxy 鏂瑰紡鐨勮礋杞藉潎琛?/span>

浣跨敤 Apache2.1 浠ヤ笂鐨勭増鏈紝灝卞彲浠ョ敤 mod_proxy_ajp 鏉ュ畬鎴愯礋杞藉潎琛$殑閰嶇疆錛屼笉榪囧埌鐩墠涓烘錛屾病鏈夌湅鍒板浣曡 Apache 璐熻矗闈欐侀儴鍒嗭紝 tomcat 璐熻矗鍔ㄦ侀儴鍒嗙殑閰嶇疆鏂瑰紡錛屽彧鑳界敤 path 榪涜鍖哄垎鍒嗗彂璇鋒眰銆傚錛氬湪铏氭嫙涓繪満鐨勯厤緗腑澧炲姞錛?/span>

ProxyPass / ajp://localhost:8019/

ProxyPassReverse / ajp://localhost:8019/

鑰屽艦濡傦細

ProxyPass /*.jsp ajp://localhost:8019/

ProxyPassReverse /*.jsp ajp://localhost:8019/

榪欐牱鐨勯厤緗槸涓嶈兘閫氳繃鐨勩?/span>



seal 2008-08-25 23:14 鍙戣〃璇勮
]]>
java.lang.OutOfMemoryError: PermGen space鍙婂叾瑙e喅鏂規(guī)硶http://www.tkk7.com/sealyu/archive/2008/08/25/224195.htmlsealsealMon, 25 Aug 2008 08:22:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/25/224195.htmlhttp://www.tkk7.com/sealyu/comments/224195.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/25/224195.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/224195.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/224195.html

1銆?br />

PermGen space鐨勫叏縐版槸Permanent Generation space,鏄寚鍐呭瓨鐨勬案涔呬繚瀛樺尯鍩烵utOfMemoryError: PermGen space浠庤〃闈笂鐪嬪氨鏄唴瀛樼泭鍑猴紝瑙e喅鏂規(guī)硶涔熶竴瀹氭槸鍔犲ぇ鍐呭瓨銆傝璇翠負浠涔堜細鍐呭瓨鐩婂嚭錛氳繖涓閮ㄥ垎鐢ㄤ簬瀛樻斁Class鍜孧eta鐨勪俊鎭?Class鍦ㄨ Load鐨勬椂鍊欒鏀懼叆PermGen space鍖哄煙錛屽畠鍜屽拰瀛樻斁Instance鐨凥eap鍖哄煙涓嶅悓,GC(Garbage Collection)涓嶄細鍦ㄤ富紼嬪簭榪愯鏈熷PermGen space榪涜娓呯悊錛屾墍浠ュ鏋滀綘鐨凙PP浼歀OAD寰堝CLASS鐨勮瘽,灝卞緢鍙兘鍑虹幇PermGen space閿欒銆傝繖縐嶉敊璇父瑙佸湪web鏈嶅姟鍣ㄥJSP榪涜pre compile鐨勬椂鍊欍?/p> 鏀規(guī)鏂規(guī)硶錛?Xms256m -Xmx256m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

2銆?/p>

鍦╰omcat涓璻edeploy鏃跺嚭鐜皁utofmemory鐨勯敊璇?

鍙互鏈変互涓嬪嚑涓柟闈㈢殑鍘熷洜:

錛?浣跨敤浜?u>proxool,鍥犱負proxool鍐呴儴鍖呭惈浜嗕竴涓佺増鏈殑cglib.

2, log4j,鏈濂戒笉鐢?鍙敤common-logging

3, 鑰佺増鏈殑cglib,蹇偣鏇存柊鍒版渶鏂扮増銆?/font>

錛旓紝鏇存柊鍒版渶鏂扮殑hibernate3.2

3銆?br />
榪欓噷浠omcat鐜涓轟緥錛屽叾瀹僕EB鏈嶅姟鍣ㄥjboss,weblogic絳夋槸鍚屼竴涓亾鐞嗐?br /> 涓銆乯ava.lang.OutOfMemoryError: PermGen space

PermGen space鐨勫叏縐版槸Permanent Generation space,鏄寚鍐呭瓨鐨勬案涔呬繚瀛樺尯鍩?
榪欏潡鍐呭瓨涓昏鏄JVM瀛樻斁Class鍜孧eta淇℃伅鐨?Class鍦ㄨLoader鏃跺氨浼氳鏀懼埌PermGen space涓?
瀹冨拰瀛樻斁綾誨疄渚?Instance)鐨凥eap鍖哄煙涓嶅悓,GC(Garbage Collection)涓嶄細鍦ㄤ富紼嬪簭榪愯鏈熷
PermGen space榪涜娓呯悊錛屾墍浠ュ鏋滀綘鐨勫簲鐢ㄤ腑鏈夊緢澶欳LASS鐨勮瘽,灝卞緢鍙兘鍑虹幇PermGen space閿欒,
榪欑閿欒甯歌鍦╳eb鏈嶅姟鍣ㄥJSP榪涜pre compile鐨勬椂鍊欍傚鏋滀綘鐨刉EB APP涓嬮兘鐢ㄤ簡澶ч噺鐨勭涓夋柟jar, 鍏跺ぇ灝?br /> 瓚呰繃浜唈vm榛樿鐨勫ぇ灝?4M)閭d箞灝變細浜х敓姝ら敊璇俊鎭簡銆?br /> 瑙e喅鏂規(guī)硶錛?鎵嬪姩璁劇疆MaxPermSize澶у皬

淇敼TOMCAT_HOME/bin/catalina.sh
鍦?#8220;echo "Using CATALINA_BASE:   $CATALINA_BASE"”涓婇潰鍔犲叆浠ヤ笅琛岋細
JAVA_OPTS="-server -XX:PermSize=64M -XX:MaxPermSize=128m
寤鴻錛氬皢鐩稿悓鐨勭涓夋柟jar鏂囦歡縐葷疆鍒皌omcat/shared/lib鐩綍涓嬶紝榪欐牱鍙互杈懼埌鍑忓皯jar 鏂囨。閲嶅鍗犵敤鍐呭瓨鐨勭洰鐨勩?/p>

浜屻乯ava.lang.OutOfMemoryError: Java heap space
Heap size 璁劇疆
JVM鍫嗙殑璁劇疆鏄寚java紼嬪簭榪愯榪囩▼涓璊VM鍙互璋冮厤浣跨敤鐨勫唴瀛樼┖闂寸殑璁劇疆.JVM鍦ㄥ惎鍔ㄧ殑鏃跺欎細鑷姩璁劇疆Heap size鐨勫鹼紝
鍏跺垵濮嬬┖闂?鍗?Xms)鏄墿鐞嗗唴瀛樼殑1/64錛屾渶澶х┖闂?-Xmx)鏄墿鐞嗗唴瀛樼殑1/4銆傚彲浠ュ埄鐢↗VM鎻愪緵鐨?Xmn -Xms -Xmx絳夐夐」鍙?br /> 榪涜璁劇疆銆侶eap size 鐨勫ぇ灝忔槸Young Generation 鍜孴enured Generaion 涔嬪拰銆?br /> 鎻愮ず錛氬湪JVM涓鏋?8錛呯殑鏃墮棿鏄敤浜嶨C涓斿彲鐢ㄧ殑Heap size 涓嶈凍2錛呯殑鏃跺欏皢鎶涘嚭姝ゅ紓甯鎬俊鎭?br /> 鎻愮ず錛欻eap Size 鏈澶т笉瑕佽秴榪囧彲鐢ㄧ墿鐞嗗唴瀛樼殑80錛咃紝涓鑸殑瑕佸皢-Xms鍜?Xmx閫夐」璁劇疆涓虹浉鍚岋紝鑰?Xmn涓?/4鐨?Xmx鍊箋?
瑙e喅鏂規(guī)硶錛氭墜鍔ㄨ緗瓾eap size
淇敼TOMCAT_HOME/bin/catalina.sh
鍦?#8220;echo "Using CATALINA_BASE:   $CATALINA_BASE"”涓婇潰鍔犲叆浠ヤ笅琛岋細
JAVA_OPTS="-server -Xms800m -Xmx800m   -XX:MaxNewSize=256m"

涓夈佸疄渚嬶紝浠ヤ笅緇欏嚭1G鍐呭瓨鐜涓媕ava jvm 鐨勫弬鏁拌緗弬鑰冿細

JAVA_OPTS="-server -Xms800m -Xmx800m  -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Djava.awt.headless=true "


涓夈佺浉鍏寵祫鏂?/p>

/show/3/7/20061112220131.htm

/show/3/7/20061112220054.htm

/show/3/7/20061112220201.htm

棰樺璇濓細緇忓父鐪嬪埌緗戝弸鎶辨╰omcat鐨勬ц兘涓嶅...錛屼笉紼沖畾絳夛紝鍏跺疄鏍規(guī)嵁絎旇呭嚑騫寸殑緇忛獙錛屼粠"浜掕仈鏄熺┖“鍒扮幇鍦ㄧ殑鎴夸駭闂ㄦ埛緗戯紝鎴戜滑
鍧囦嬌鐢╰omcat浣滀負WEB鏈嶅姟鍣紝姣忓ぉ璁塊棶閲忕櫨涓囧錛宼omcat浠嶇劧榪愯鑹ソ銆傚緩璁ぇ瀹舵湁闂澶氫粠鑷繁紼嬪簭鍏ユ墜錛屽鐪嬬湅java鐨凞OC鏂囨。
騫惰緇嗕簡瑙VM鐨勭煡璇嗐傝繖鏍峰紑鍙戠殑紼嬪簭鎵嶄細鍋ュ.銆?br />
寤朵幾闃呰錛?/span>

JVM 鎬ц兘璋冩暣鐨勪竴浜涘熀鏈蹇?/font>

apache+Tomcat璐熻澆騫寵 璁劇疆璇﹁В[杞琞

java - the Java application launcher

JVM璋冧紭[杞琞



seal 2008-08-25 16:22 鍙戣〃璇勮
]]>
Redhat AS4浣跨敤jsvc緙栧啓tomcat鑷惎鍔ㄥ畨鍏ㄨ剼鏈?杞?http://www.tkk7.com/sealyu/archive/2008/08/18/222685.htmlsealsealMon, 18 Aug 2008 02:10:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/18/222685.htmlhttp://www.tkk7.com/sealyu/comments/222685.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/18/222685.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/222685.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/222685.html #cd /usr/local/xiaobai/apache-tomcat-5.5.20/bin
#tar xvfz jsvc.tar.gz
#cd jsvc-src
#sh support/buildconf.sh
#chmod 755 configure
#./configure --with-java=/usr/local/xiaobai/jdk1.5.0_09 (鏀規(guī)垚浣犵殑JDK鐨勪綅緗?
#make

2銆佹坊鍔犺剼鏈tomcat鑷姩鍚姩
#useradd tomcat5 娣誨姞鐢ㄦ埛
#groupadd tomcat銆銆娣誨姞緇?
#usermod -G tomcat tomcat5銆銆鎶妕omcat5鍔犲叆tomcat緇?

#chown -R tomcat5 /usr/local/xiaobai/apache-tomcat-5.5.20
璁劇疆鐢ㄦ埛tomcat5瀵箃omcat鐨勬潈闄?

#cp /usr/local/xiaobai/apache-tomcat-5.5.20/bin/jsvc-src/native/Tomcat5.sh /etc/init.d/tomcat
縐誨姩鏂囦歡tomcat5.sh鍒?etc/init.d/閲岄潰騫舵敼鍚嶄負tomcat

#chmod 755 /etc/init.d/tomcat
#vi /etc/init.d/tomcat

鍒犻櫎鍘熸湁鍐呭娣誨姞濡備笅鍐呭

#!/bin/sh
#
# Startup Script for Tomcat5
#
# chkconfig: 345 88 14
# description: Tomcat Daemon
# processname: jsvc
# pidfile: /var/run/jsvc.pid
# config:
#
# Source function library.
. /etc/rc.d/init.d/functions
#
prog=tomcat
#
JAVA_HOME=/usr/local/xiaobai/jdk1.5.0_09
CATALINA_HOME=/usr/local/xiaobai/apache-tomcat-5.5.20
DAEMON_HOME=/usr/local/xiaobai/apache-tomcat-5.5.20/bin
#TOMCAT_USER=tomcat5
TOMCAT_USER=tomcat5

# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=/usr/local/xiaobai/apache-tomcat-5.5.20

CATALINA_OPTS=
CLASSPATH="
$JAVA_HOME/lib/tools.jar:"
$CATALINA_HOME/bin/commons-daemon.jar:"
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
start)
#
# Start Tomcat
#
$DAEMON_HOME/jsvc-src/jsvc "
-user $TOMCAT_USER "
-home $JAVA_HOME "
-Dcatalina.home=$CATALINA_HOME "
-Dcatalina.base=$CATALINA_BASE "
-Djava.io.tmpdir=$TMP_DIR "
-wait 10 "
-pidfile $PID_FILE "
-outfile $CATALINA_HOME/logs/catalina.out "
-errfile '&1' "
$CATALINA_OPTS "
-cp $CLASSPATH "
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose "
# To get a debug of jsvc.
#-debug "
exit $?
;;

stop)
#
# Stop Tomcat
#
$DAEMON_HOME/jsvc-src/jsvc "
-stop "
-pidfile $PID_FILE "
org.apache.catalina.startup.Bootstrap
exit $?
;;

*)
echo "Usage tomcat.sh start/stop"
exit 1;;
esac

#service tomcat start 嫻嬭瘯tomcat鑳戒笉鑳藉惎鍔?
#chkconfig tomcat on
#chkconfig --list tomcat
瀹屾垚鑷惎鍔ㄨ剼鏈?

娉ㄦ剰錛?
鍦╰omcat鏂囦歡鐨勫ご涓よ鐨勬敞閲婅鍙ヤ腑錛岄渶瑕佸寘鍚玞hkconfig鍜宒escription涓ら儴鍒嗗唴瀹?紜涓嶈鎷煎啓閿欒錛?錛屽惁鍒欏湪鎵ц“chkconfig --add tomcat”鏃訛紝浼氬嚭鐜?#8220;tomcat鏈嶅姟涓嶆敮鎸乧hkconfig”鐨勯敊璇彁紺恒?
chkconfig榪欒琛ㄧず緙虹渷鍚姩鐨勮繍琛岀駭鍒互鍙婂惎鍔ㄥ拰鍋滄鐨勪紭鍏堢駭錛屽璇ユ湇鍔$己鐪佷笉鍐嶄換浣曡繍琛岀駭鍚姩錛屽垯浠?- 浠f浛榪愯綰у埆銆傚湪tomcat涓〃紺鴻剼鏈湪榪愯綰?銆?銆?銆?鍚姩錛屽惎鍔ㄤ紭鍏堟潈涓?0錛屽仠姝紭鍏堟潈涓?0銆?
description琛屽鏈嶅姟榪涜鎻忚堪錛屽彲浠ョ敤 “"” 璺ㄨ娉ㄩ噴銆?/span>

seal 2008-08-18 10:10 鍙戣〃璇勮
]]>
Apache璁劇疆铏氭嫙绔欑偣鎬葷粨http://www.tkk7.com/sealyu/archive/2008/08/14/221988.htmlsealsealThu, 14 Aug 2008 06:10:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/14/221988.htmlhttp://www.tkk7.com/sealyu/comments/221988.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/14/221988.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/221988.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/221988.html

鍦ㄦ暣鍚圓pache鍜孴omcat涔嬪悗錛屽彂鐜拌鏈嶅姟鍣ㄧ殑涓や釜緗戠珯涓涓槸闈欐佺殑錛屼竴涓槸鍔ㄦ乯sp鐨勶紝璁劇疆鎬葷粨濡備笅

涓昏璁劇疆httpd.conf

1銆丏irectoryIndex鐨勮緗?/p>

濡傛灉澶氫釜铏氭嫙绔欑偣涓寘鍚縐嶆枃浠舵牸寮忓拰鏂囦歡鍚嶇殑棣栭〉鏂囦歡錛屽繀欏誨湪榪欓噷鍏ㄩ儴鍑虹幇

2銆佸涓珯鐐圭殑瀹氫箟濡備笅

#NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
NameVirtualHost 220.231.32.*:80

<VirtualHost 220.231.32.*:80>
    ServerAdmin liubin@sina.com
    DocumentRoot /usr/local/tomcat/webapps/ronglian
    ServerName www.ronglian.com
    ErrorLog logs/ronglian.com-error_log
    CustomLog logs/ronglian.com-access_log common
</VirtualHost>

<VirtualHost 220.231.32.*:80>
    ServerAdmin wellboby@tom.com
    DocumentRoot /usr/local/wwwroot/chinaface
    ServerName www.chinaface.net
    ErrorLog logs/chinaface.net-error_log
    CustomLog logs/chinaface.net-access_log common
</VirtualHost>

錛侊紒 鍦ㄨ繖閲岋紝NameVirtualHost鐨勫瓧孌典笉鑳界渷鐣ワ紝鍚﹀垯璧穉pache鏃舵姤閿欙細VirtualHost 220.231.32.*.80 overlaps with VirtualHost 220.231.32.*:80, the first has precedence, perhaps you need a NameVirtualHost directive鈥斺旇櫧鐒禷pache鑳借搗錛屽悓閿欒鎻忚堪涓鏍鳳紝絎簩涓珯鐐圭殑瀹氫箟琚涓涓珯鐐圭殑瀹氫箟鎵瑕嗙洊錛屽嵆璁塊棶絎簩涓珯鐐規(guī)寚鍚戠殑鍏跺疄鏄涓涓?/p>

錛侊紒 NameVirtualHost瀛楁鐨勭鍙e彿涓嶈兘蹇界暐錛屽惁鍒欒搗apache鏃舵姤閿欙細VirtualHost 220.231.32.*:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Jul 09 16:59:37 2006] [error] VirtualHost 220.231.32.*:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results鈥斺攁pache涓嶈兘璧?/p>

錛侊紒濡傛灉VirtualHost 瀛楁鐨勭鍙e彿紜疄錛岃搗apache鏃舵姤閿欙細VirtualHost 220.231.32.28:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results鈥斺斾絾apache鍙互鍚姩錛岃闂篃姝e父



seal 2008-08-14 14:10 鍙戣〃璇勮
]]>
TomCat澶氳櫄鎷熺珯鐐歸厤緗紙杞級http://www.tkk7.com/sealyu/archive/2008/08/14/221921.htmlsealsealThu, 14 Aug 2008 03:25:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/14/221921.htmlhttp://www.tkk7.com/sealyu/comments/221921.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/14/221921.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/221921.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/221921.html闃呰鍏ㄦ枃

seal 2008-08-14 11:25 鍙戣〃璇勮
]]>
apache2.2涓巘omcat闆嗘垚(鍙互澶氫釜tomcat)http://www.tkk7.com/sealyu/archive/2008/08/11/221381.htmlsealsealMon, 11 Aug 2008 14:05:00 GMThttp://www.tkk7.com/sealyu/archive/2008/08/11/221381.htmlhttp://www.tkk7.com/sealyu/comments/221381.htmlhttp://www.tkk7.com/sealyu/archive/2008/08/11/221381.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/221381.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/221381.htmlhttp://ttitfly.javaeye.com/admin/show/127337

2.闇姹傛鍐碉細
鏈?涓湇鍔★細www.test.com, bbs.test.com銆傚垎鍒搴?涓猼omcat涓嬬殑2涓獁eb搴旂敤銆傜敱apache httpd浣滀負浜掕仈緗戞帴鍏ユ湇鍔″櫒錛屽湪80绔彛鎺ユ敹瀵硅繖2涓湇鍔$殑璇鋒眰銆俛pache httpd鍐嶅皢榪?涓姹傚垎鍒搴斿埌涓嶅悓鐨勫悗绔痺eb鏈嶅姟鍣?Tomcat)澶勭悊銆?

3.閰嶇疆鍩熷悕鏄犲皠鍒版湰鏈哄嵆127.0.0.1錛屽悓鏃墮厤緗畇ervice鍩熷悕

Java浠g爜 澶嶅埗浠g爜
  1. 127.0.0.1    localhost www.test.com www.service.test.com bbs.test.com bbs.service.test.com  


4. 鍒嗗埆鍦?涓猼omcat閲屽垎鍒儴緗蹭竴涓潪甯哥畝鍗曠殑搴旂敤銆?

絎竴涓猼omcat 錛氱鍙?8080

緙栬緫$TOMCAT_HOME/conf/server.xml

娣誨姞涓涓狧ost
Java浠g爜 澶嶅埗浠g爜
  1. <Host name="www.service.test.com" unpackWARs="true" autoDeploy="true"  
  2. xmlValidation="false" xmlNamespaceAware="false"/>  


鍐嶅湪$TOMCAT_HOME/conf/Catalina涓嬪緩绔嬩竴涓洰褰?www.service.test.com
鐒跺悗鍦╳ww.service.test.com鐩綍涓嬪緩绔嬩竴涓猂OOT.xml,鍐呭涓猴細
Java浠g爜 澶嶅埗浠g爜
  1. <Context docBase="/home/mahaibo/app/test"  
  2. privileged="true" antiResourceLocking="false" antiJARLocking="false">  
  3. </Context>  

docBase鎸囧悜鍏蜂綋鐨勯」鐩礬寰?/span>

鍚岀悊絎簩涓猼omcat錛堢鍙?088錛変篃鏄竴鏍風(fēng)殑鍋氭硶錛?

緙栬緫$TOMCAT_HOME/conf/server.xml

娣誨姞涓涓狧ost:
Java浠g爜 澶嶅埗浠g爜
  1. <Host name="bbs.service.test.com" unpackWARs="true" autoDeploy="true"  
  2. xmlValidation="false" xmlNamespaceAware="false"/>  



鐒跺悗鍦?TOMCAT_HOME/conf/Catalina涓嬪緩绔嬩竴涓洰褰?bbs.service.test.com

鍐嶅湪bbs.service.test.com鐩綍涓嬪緩绔嬩竴涓猂OOT.xml,鍐呭涓猴細
Java浠g爜 澶嶅埗浠g爜
  1. <Context docBase="/home/mahaibo/app/bbs"  
  2. privileged="true" antiResourceLocking="false" antiJARLocking="false">  
  3. </Context>  


5. 鍒嗗埆鍚姩tomcat錛屽彲浠ラ氳繃http://www.service.test.com:8080鍜宧ttp://bbs.service.test.com:8088璁塊棶

6. 閰嶇疆a(chǎn)pache httpd.conf鏂囦歡銆?

鎵懼埌apach/conf/httpd.conf鏂囦歡錛岀‘璁や笅闈㈣繖浜涙枃瀛楄鍓嶉潰娌℃湁"#"娉ㄩ噴鍙鳳細

Java浠g爜 澶嶅埗浠g爜
  1. LoadModule proxy_module modules/mod_proxy.so  
  2. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so  
  3. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so  
  4. LoadModule proxy_connect_module modules/mod_proxy_connect.so  
  5. LoadModule proxy_http_module modules/mod_proxy_http.so  
  6. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so  


騫跺鍔犺櫄鎷熶富鏈洪厤緗細
Java浠g爜 澶嶅埗浠g爜
  1. NameVirtualHost *:80  
  2. <VirtualHost *:80>  
  3. ServerName www.test.com  
  4. ProxyIOBufferSize 8192  
  5. ProxyRequests Off  
  6. ProxyVia Full  
  7. ProxyPass / http://www.service.test.com:8080/ smax=5 max=20 ttl=120 retry=300  
  8. </VirtualHost>  
  9.   
  10. <VirtualHost *:80>  
  11. ServerName bbs.test.com  
  12. ProxyIOBufferSize 8192  
  13. ProxyRequests Off  
  14. ProxyVia Full  
  15. ProxyPass / http://bbs.service.test.com:8088/ smax=5 max=20 ttl=120 retry=300  
  16. </VirtualHost>  


7.鍚姩apache
Java浠g爜 澶嶅埗浠g爜
  1. ./apachectl start  


8 鍙互閫氳繃璁塊棶http://www.test.com鍜宧ttp://bbs.test.com鏉ュ垎鍒闂?涓笉鍚宼omcat涓嬬殑涓嶅悓搴旂敤浜嗐?

seal 2008-08-11 22:05 鍙戣〃璇勮
]]>
Apache閰嶇疆 铏氭嫙杞悜瀹炰緥錛堣漿錛?/title><link>http://www.tkk7.com/sealyu/archive/2008/08/11/221312.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Mon, 11 Aug 2008 07:32:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/08/11/221312.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/221312.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/08/11/221312.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/221312.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/221312.html</trackback:ping><description><![CDATA[NameVirtualHost *:80 榪欎釜涓瀹氳 <br /> 鐒跺悗鎶婁富鐨凷erverAdmin涓㈡渶涓嬮潰 <br /> ///////////////////// <br /> NameVirtualHost *:80 <br /> <VirtualHost *:80> <br /> ServerName abccccc.com <br /> ProxyPass / http://localhost:8088/ <br /> ProxyPassReverse / http://localhost:8088/ <br /> </VirtualHost> <br /> <br /> #璁劇疆铏氭嫙涓繪満 <br /> <VirtualHost *:80> <br /> ServerAdmin www.adddd.com <br /> DocumentRoot E:/Tomcat/webapps/ROOT  <br /> #鎮(zhèn)ㄧ殑绔欑偣欏圭洰鎵鍦ㄨ礬寰勶紝搴斾笌tomcat涓殑鐩綍璁劇疆鐩稿悓 <br /> ServerName www.adddd.com <br /> Alias /p "F:""uploadFiles" <br /> <Directory "F:""uploadFiles"> <br />     Options -Indexes MultiViews <br />     AllowOverride None <br />     Order allow,deny <br />     Allow from all <br /> </Directory> <br /> <br /> Alias /aaaaaa "F:""aaaaaa" <br /> <Directory "F:""aaaaaa"abcc"> <br />     Options -Indexes MultiViews <br />     AllowOverride None <br />     Order allow,deny <br />     Allow from all <br /> </Directory> <br /> DirectoryIndex index.html index.htm index.jsp <br /> ErrorLog logs/shsc-error_log.txt <br /> CustomLog logs/shsc-<a target="_blank"><font color="red">access</font></a>_log.txt common <br /> JkMount /servlet/* ajp13  <br /> #璁〢pache鏀寔瀵箂ervlet浼犻侊紝鐢ㄤ互Tomcat瑙f瀽 <br /> JkMount /*.jsp ajp13  <br /> #璁〢pache鏀寔瀵筳sp浼犻侊紝鐢ㄤ互Tomcat瑙f瀽 <br /> JkMount /*.do ajp13  <br /> #璁〢pache鏀寔瀵?do浼犻侊紝鐢ㄤ互Tomcat瑙f瀽 <br /> </VirtualHost> <br /> ///////////////////// <img src ="http://www.tkk7.com/sealyu/aggbug/221312.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-08-11 15:32 <a href="http://www.tkk7.com/sealyu/archive/2008/08/11/221312.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Apache 2.2.9 鍜?Tomcat 5.5.26 鐨勮嚜鍔ㄩ泦鎴?/title><link>http://www.tkk7.com/sealyu/archive/2008/07/17/215597.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Thu, 17 Jul 2008 14:27:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/07/17/215597.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/215597.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/07/17/215597.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/215597.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/215597.html</trackback:ping><description><![CDATA[<p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">闆嗘垚 Apache 鍜?Tomcat 鍚庯紝Tomcat 鐨勫簲鐢ㄥ彲浠ラ氳繃 Apache 鏉ヨ闂傝繖涓姛鑳戒嬌鐢ㄤ簡涓涓?mod_jk.so 鐨勬ā鍧楋紝鏈夊叧榪欎釜鏂歸潰鐨勯厤緗浘緇忓洶鎵頒簡鎴戝緢涔咃紝鎴戠浉淇′篃緇欎笉灝戜漢甯︽潵浜嗛夯鐑︺傝繖嬈℃垜瑕佽鐨勬槸涓縐嶆洿鍔犵畝渚跨殑閰嶇疆鏂瑰紡錛氳嚜鍔ㄥ寲閰嶇疆銆?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">鑷姩鍖栭厤緗殑鍓嶆彁鏄彧鏈変竴涓?Tomcat 瀹炰緥鍜?Apache 鍦ㄥ悓涓鍙版満鍣ㄤ笂榪愯銆傝嚜鍔ㄥ寲閰嶇疆鏄氳繃鍦?Tomcat 鐨勯厤緗枃浠?server.xml 涓殑 Engine 鍏冪礌涓坊鍔犵浉搴旂殑 ApacheConfig 鐩戝惉鍣?Listener)鏉ュ疄鐜扮殑銆?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">涓嬮潰鏄叿浣撶殑閰嶇疆錛?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎竴姝ワ細涓嬭澆騫跺畨瑁?Apache httpd鍜?Tomcat</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">涓嬭澆騫跺畨瑁?Apache 2.2.9 鍜?Tomcat 5.5.26錛屽亣璁句粬浠殑瀹夎鐩綍濡備笅錛?/span></p> <p style="margin-left: 10.5pt; text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">D:/apps/Apache/Apache2.2 </span></p> <p style="margin-left: 10.5pt; text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">D:/apps/Apache/apache-tomcat-5.5.26</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">榪欎袱涓湇鍔″櫒鍙互鍦ㄤ互涓嬪湴鍧涓嬭澆錛?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">Tomcat: </span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">http://apache.osuosl.org/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.zip</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">Apache:</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;"><a >http://apache.osuosl.org/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi</a></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎簩姝ワ細涓嬭澆騫跺畨瑁?mod_jk.so </span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">mod_jk </span><span style="font-size: 12pt; font-family: 瀹嬩綋;">鐨勪笅杞藉湴鍧濡備笅錛?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">http://apache.osuosl.org/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.26/mod_jk-1.2.26-httpd-2.2.4.so</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">涓嬭澆鍚庡皢鍏墮噸鍛藉悕騫跺鍒跺埌鍒?D:/apps/Apache/Apache2.2/modules 涓?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎笁姝ワ細鍒涘緩 workers.properties 鏂囦歡</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">workers.properties </span><span style="font-size: 12pt; font-family: 瀹嬩綋;">瀹氫箟浜嗘瘡涓?worker 鐨勭被鍨嬨佸崗璁佺鍙g瓑淇℃伅銆傚鏋滄墜涓婃病鏈夌幇鎴愮殑閰嶇疆鏂囦歡錛屽彲浠ヤ嬌鐢ㄤ互涓嬫渶綆鍗曠殑閰嶇疆錛?/span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"># Define 1 real worker using ajp13</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">worker.list=worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"># Set properties for worker1 (ajp13)</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">worker.worker1.type=ajp13</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">worker.worker1.host=localhost</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">worker.worker1.port=8009</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">灝嗚繖涓枃浠舵斁鍦?Tomcat 涓嬬殑 conf/jk 鐩綍涓紝濡傛灉鏀懼湪鍏朵粬鍦版柟錛屽垯闇瑕佸湪 server.xml 鐨勯厤緗腑鏄庣‘鎸囧畾銆?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎洓姝ワ細淇敼 Tomcat server.xml 鏂囦歡</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">鎵懼埌涓嬮潰榪欒鍐呭騫跺湪鍚庨潰娣誨姞閰嶇疆淇℃伅錛?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">   <span style="font-family: Courier New; color: #800000;"><Engine name="Catalina" defaultHost="localhost"></span></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">閰嶇疆淇℃伅濡備笅錛?/span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    <Listener className="org.apache.jk.config.ApacheConfig" </span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       workersConfig="conf/workers.properties"</span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       modJk="D:/apps/Apache/Apache2.2/modules/mod_jk.so"</span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       jkLog="logs/mod_jk.log"</span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       jkDebug="info"</span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       jkWorker="worker1" </span></p> <p style="text-align: left; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">       noRoot="true"</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;"><span style="font-family: Courier New; color: #800000;">    /></span></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">鍏朵腑錛?/span></p> <ul> <li><span style="font-size: 12pt; font-family: 瀹嬩綋;">workersConfig </span><span style="font-size: 12pt; font-family: 瀹嬩綋;">鏄?workers.properties 鐨勪綅緗紝榪欓噷鎴戞病鏈変嬌鐢ㄩ粯璁ょ殑浣嶇疆錛屾墍浠ュ湪姝ゆ槑紜鏄庝簡銆?/span></li> </ul> <ul> <li><span style="font-size: 12pt; font-family: 瀹嬩綋;">modJk</span><span style="font-size: 12pt; font-family: 瀹嬩綋;">錛氬畾涔変簡 mod_jk.so 鐨勫叿浣撲綅緗?/span></li> </ul> <ul> <li><span style="font-size: 12pt; font-family: Wingdings;"><span style="font-size: 12pt; font-family: 瀹嬩綋;">jkLog </span><span style="font-size: 12pt; font-family: 瀹嬩綋;">瀹氫箟浜?mod_jk.log 鐨勪綅緗紝榪欓噷鏄?tomcat 涓嬬殑 logs 鐩綍</span></span></li> </ul> <ul> <li><span style="font-size: 12pt; font-family: Wingdings;"><span style="font-size: 12pt; font-family: 瀹嬩綋;">jkDebug</span><span style="font-size: 12pt; font-family: 瀹嬩綋;">錛氬畾涔夋棩蹇楃駭鍒紝鍙互浣跨敤鐨勭駭鍒湁錛歞ebug, info, error, 鎴栬?emerg錛岄粯璁や負 emerg</span></span></li> </ul> <ul> <li><span style="font-size: 12pt; font-family: Wingdings;"><span style="font-size: 12pt; font-family: 瀹嬩綋;">jkWorker</span><span style="font-size: 12pt; font-family: 瀹嬩綋;">錛氬畾涔?worker 鐨勫悕縐幫紝蹇呴』鏄湪 workers.properties 涓畾涔夎繃鐨勫悕縐幫紝鍚﹀垯鍙兘浼氬嚭鐜?internal server error 鐨勯敊璇?/span></span></li> </ul> <ul> <li><span style="font-size: 12pt; font-family: Wingdings;"><span style="font-size: 12pt; font-family: 瀹嬩綋;">noRoot</span><span style="font-size: 12pt; font-family: 瀹嬩綋;">錛氬鏋滀負 true錛屽垯鏍圭洰褰曚笉浼氭槧灝勫埌 Tomcat 鐨勬牴鐩綍錛宖alse 鍒欐槧灝勫埌 Tomcat 鏍圭洰褰曪紝濡傛灉鏄?false 鐨勮瘽錛?a href="http://localhost/">http://localhost/</a> 浼氭墦寮 Tomcat 鐨勬榪庨〉闈紙ROOT錛?/span></span></li> </ul> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎簲姝ワ細淇敼 Apache httpd.conf 鏂囦歡</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">鎵懼埌 httpd.conf 鏂囦歡騫跺湪鏈鍚庡姞涓婂涓嬮厤緗細</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">#To be added at the end of your httpd.conf</span></p> <p style="text-align: left; margin-left: 40px;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;"><span style="font-family: Courier New; color: #800000;">Include $TOMCAT_HOME/conf/auto/mod_jk.conf</span></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">瑕佹敞鎰忕殑鏄紝榪欓噷 Include 鍚庨潰鐨勮礬寰勫繀欏繪紜紝榪欓噷 $TOMCAT_HOME 鏄?Tomcat 瀹夎鐩綍錛孌:/apps/Apache/apache-tomcat-5.5.26銆?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎叚姝ワ細閲嶅惎 Tomcat 騫惰嚜鍔ㄧ敓鎴?mod_jk.conf</span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">閲嶅惎 Tomcat錛岄噸鍚垚鍔熷悗浼氬湪鍏?conf 涓嬮潰鐢熸垚 mod_jk.conf 鏂囦歡錛岃繖涓厤緗枃浠跺氨鏄湪 httpd.conf 涓鐢ㄥ埌鐨勯偅涓紝榪欎釜鏂囦歡鐨勮礬寰勫繀欏誨拰鍦?httpd.conf 涓殑涓鑷淬備笅闈㈡槸鐢熸垚鐨勪竴涓猰od_jk.conf錛?/span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">########## Auto generated on Sun Jun 29 11:21:57 CST 2008##########</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"><IfModule !mod_jk.c></span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"> LoadModule jk_module "D:/apps/Apache/Apache2.2/modules/mod_jk.so"</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"></IfModule></span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">JkWorkersFile "D:/apps/Apache/apache-tomcat-5.5.26/conf/workers.properties"</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">JkLogFile "D:/apps/Apache/apache-tomcat-5.5.26/logs/mod_jk.log"</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">JkLogLevel info</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;"><VirtualHost localhost></span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    ServerName localhost</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /webdav worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /webdav/* worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /servlets-examples worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /servlets-examples/* worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /tomcat-docs worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /tomcat-docs/* worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /jsp-examples worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /jsp-examples/* worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /balancer worker1</span></p> <p style="text-align: left; margin-left: 40px; font-family: Courier New; color: #800000;" class="MsoNormal" align="left"><span style="font-size: 12pt;">    JkMount /balancer/* worker1</span></p> <p style="text-align: left; margin-left: 40px;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;"><span style="font-family: Courier New; color: #800000;"></VirtualHost></span></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">絎竷姝ワ細鍚姩 Apache 騫舵祴璇曢厤緗?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;">Apache </span><span style="font-size: 12pt; font-family: 瀹嬩綋;">鍚姩瀹屾垚鍚庯紝嫻嬭瘯濡備笅鍦板潃錛?/span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-size: 12pt; font-family: 瀹嬩綋;"><a href="http://localhost/jsp-examples">http://localhost/jsp-examples</a></span></p> <p style="text-align: left;" class="MsoNormal" align="left"><span style="font-family: 瀹嬩綋;">濡傛灉欏甸潰鑳芥甯告樉紺猴紝璇存槑閰嶇疆鎴愬姛錛佸鏋滃嚭鐜?/span> internal server error <span style="font-family: 瀹嬩綋;">涔嬬被鐨勯敊璇紝璇存槑涓婇潰鐨勯厤緗湁璇紝闇瑕佹鏌ュ茍嫻嬭瘯銆?/span></p> <img src ="http://www.tkk7.com/sealyu/aggbug/215597.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-07-17 22:27 <a href="http://www.tkk7.com/sealyu/archive/2008/07/17/215597.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Working with mod_jkhttp://www.tkk7.com/sealyu/archive/2008/07/17/215595.htmlsealsealThu, 17 Jul 2008 14:01:00 GMThttp://www.tkk7.com/sealyu/archive/2008/07/17/215595.htmlhttp://www.tkk7.com/sealyu/comments/215595.htmlhttp://www.tkk7.com/sealyu/archive/2008/07/17/215595.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/215595.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/215595.htmlBy Gal Shachor <shachor@il.ibm.com>

Table of Contents


What is mod_jk?

mod_jk is a replacement to the elderly mod_jserv. It is a completely new Tomcat-Apache plug-in that handles the communication between Tomcat and Apache.


Why mod_jk?

Several reasons:

  • mod_jserv was too complex. Because it was ported from Apache/JServ, it brought with it lots of JServ specific bits that aren't needed by Apache.
  • mod_jserv supported only Apache. Tomcat supports many web servers through a compatibility layer named the jk library. Supporting two different modes of work became problematic in terms of support, documentation and bug fixes. mod_jk should fix that.
  • The layered approach provided by the jk library makes it easier to support both Apache1.3.x and Apache2.xx.
  • Better support for SSL. mod_jserv couldn't reliably identify whether a request was made via HTTP or HTTPS. mod_jk can, using the newer Ajpv13 protocol.

What does it mean to me?

You will need to get to know a new simplified configuration mechanism. The advantage is that learning this mechanism will give you a head start if you want to deploy Tomcat on Apache and other web servers, such as Microsoft's Internet Information Server (IIS) and the iPlanet Enterprise Web Server.


Definitions and Terminology

In this document I am going to use a few terms, so let's define them:

Term

Meaning

Worker Process

A worker is a tomcat instance that is running to serve servlet requests coming from the web server. In most cases there is only a single worker (the one and only tomcat process) but sometimes you will run multiple workers to achieve load balancing or site partitioning. Each worker is identified to the web server by the host were it is located, the port where it listens and the communication protocol used to exchange messages.

In-Process Worker

This is a special worker. Instead of working with a Tomcat process residing on another process, the web server opens a JVM and executes Tomcat inside the web server process address space. Our discussion in this document is not going to get into this special worker.

Web Server Plug-in/Tomcat Redirector

For Tomcat to cooperate with any web server it needs an "agent" to reside in the web server and send him servlet requests. This is the web server plug-in, and in our case the web server plug-in is mod_jk. The redirector usually comes in the shape of a DLL or shared object module that you plug into the web server.

Plug-in Configuration

We need to configure the web server plug-in so that it knows where the different Tomcat workers are and to which of them it should forward requests. This information, accompanied with some internal parameter, such as the log level, comprises the plug-in configuration.

Web Server Configuration

Each web server has some configuration that defines its behavior, e.g. on which port to listen, what files to serve, what web server plug-ins to load, etc. You will need to modify your web server configuration to instruct it to load the Tomcat redirector mod_jk.


Obtaining mod_jk

mod_jk can be obtained in two formats - binary and source.  Depending on the platform you are running your web server on, a binary version of mod_jk may be available.  It is recommended to use the binary version if one is available.  If the binary is not available, follow the instructions for building mod_jk from source.  Notes at the end of this section offer recommendations for specific platforms.

mod_jk Binaries

Binaries for mod_jk are available for several platforms in the same area as the Tomcat Binary Release.  The binaries are located in subdirectories by platform.  For some platforms, such as Windows, this is the typical way of obtaining mod_jk since most Windows systems do not have C compilers.  For others, the binary distribution of mod_jk offers simpler installation.

For example, the Tomcat 3.3 M1 Release at http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-m1/bin/ contains the following:

linux/i386/ Contains mod_jk.so for Apache 1.3 for the standard API as well as EAPI and mod_jk.so for Apache 2.0
netware/ Contains the mod_jk.nlm and nsapi.nlm
win32/ Contains the mod_jk.dll for Windows as well as other useful binaries.

Check the site for the latest binaries.

Note: The version of mod_jk is not dependent on the version of Tomcat.  The Tomcat 3.3 distribution of mod_jk will function correctly with other 3.x versions of Tomcat, such as Tomcat 3.2.1.

Building mod_jk

mod_jk is available in source distribution for all Windows and most Unix platforms.  The source for mod_jk is included in the Binary Distribution of Tomcat in the TOMCAT_HOME/native/mod_jk/ directory.  This directory is organized by Web Server name and version.  Each directory contains the source as well as the appropriate build scripts, make files, or project files.

Building mod_jk for NT

The redirector was developed using Visual C++ version 6.0, so having this environment is a prerequisite if you want to perform a custom build.

The steps that you need to take are:

  1. Change directory to the apache1.3 or apache2.0 source directory depending on your version of Apache.
  2. Set an APACHE1_HOME environment variable which points to where your Apache is installed.
  3. Execute the following command:

    MSDEV mod_jk.dsp /MAKE ALL

    If msdev is not in your path, enter the full path to msdev.exe. Also, ApacheCore.lib is expected to exist in the APACHE1_HOME"src"CoreD and APACHE1_HOME"src"CoreR directories before linking will succeed. You will need to build enough of the Apache source to create these libraries.
  4. Copy mod_jk.dll to Apache's modules directory.

This will build both release and debug versions of the redirector plug-in (mod_jk).

An alternative will be to open mod_jk.dsp in msdev and build it using the build menu.

Building mod_jk for Unix

Apache

  1. Make sure your Apache has DSO support. You can check this with $APACHE_HOME/bin/httpd -l. If you see "mod_so.c" in the output, DSO support is available. If it's missing, you may have to recompile or reinstall Apache.
  2. Find out whether your Apache has EAPI support. If you compiled it yourself from source, EAPI is probably not compiled in, unless you added it yourself (perhaps with mod_ssl). You need to build mod_jk.so with or without EAPI to match your Apache configuration. If you install a mismatched mod_jk.so, $APACHE_HOME/bin/apachectl configtest will warn you.
  3. Make sure you have Perl 5 installed. The apxs script used to build the module is written in Perl.
  4. Change directory to TOMCAT_HOME/native/mod_jk/apache1.3 (or apache2.0).
  5. Build mod_jk.so. Following are three techniques you can try, in order of simplicity:

    1. Run the build script for your platform.  If a build script is not available for your platform, you may be able to build mod_jk using ./build-unix.sh. This script will set some variables, call apxs as below, and try to copy mod_jk.so to $APACHE_HOME/libexec. If it fails, you need to do the following manually:
      • set JAVA_HOME in your shell, e.g. "set JAVA_HOME=/usr/local/jdk1.2.2; export JAVA_HOME"
      • set APACHE_HOME in your shell, e.g. "set APACHE_HOME=/usr/local/apache; export APACHE_HOME"
      • uncomment the following line in the build-unix.sh file, replacing "linux" with the name of your platform as specified in the Java include directory for your installation
        # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux"
    2. If build-unix.sh fails, you may have better luck with the Makefiles in the same directory, e.g. "make -f Makefile.linux mod_jk.so"
    3. Finally, you can try to build it manually. Run the apxs command that came with your apache distribution (hint: look in /usr/local/apache/bin, /usr/sbin, or wherever you installed apache). Type the command all on one line.


      For Linux:

      apxs -o mod_jk.so -I../jk -I/usr/local/jdk/include -I/usr/local/jdk/include/linux -c *.c ../jk/*.c

      Your build may fail because the object files from the ../jk directory have been compiled to the current directory, rather than their source directory. Running gcc -shared -o mod_jk.so *.o should finish the build.


      For Solaris:

      Use the build-solaris.sh script as follows:

      # sh build-solaris.sh

      This will build and install mod_jk.so in your apache/libexec directory.  This script contains settings for your Java and Apache home locations.  Make sure that these are set according to your installation.  The default settings are JAVA_HOME=/usr/java and APACHE_HOME=/usr/local/apache.  If your installation is different, you will need to edit the build-solaris.sh script and change these values appropriately.

      See README.solaris located in TOMCAT_HOME/native/mod_jk/apache1.3 for more information.

      If the build script does not work, you can also build mod_jk as follows:

      $APACHE_HOME/bin/apxs -o mod_jk.so -DSOLARIS -I../jk -I/usr/java/include -I/usr/java/include/solaris -c *.c ../jk/*.c

      On some systems, this will build the module correctly, but will fail at runtime with a "symbol "fdatasync" not found". To fix, add -lposix4 just before the -c in the above command.


      For HP-UX 11.00:

      Use the build-hpux.sh script as follows:

      # sh build-hpux.sh

      This will build and install mod_jk.so in your apache/libexec directory.  This script contains settings for your Java and Apache home locations.  Make sure that these are set according to your installation.  The default settings are JAVA_HOME=/opt/java1.3 and APACHE_HOME=/usr/local/apache.  If your installation is different, you will need to edit the build-hpux.sh script and change these values appropriately.

      Also note that there are two HP-UX build scripts.  One script was written to build mod_jk without JNI support using GNU GCC.  The other script builds mod_jk with JNI support, however, this script requires the HP ANSI C Compiler (not the stripped down C compiler included with HP-UX to rebuild the kernel).  The HP Compiler is required because the dlopen() and related shared libraries are only available for 64-bit applications and reliable 64-bit compilation is not available with the current version of GCC.

      The build-hpux.sh script should also work for HP-UX 10.00.

      See README.hpux located in TOMCAT_HOME/native/mod_jk/apache1.3 for more information.


      For other Unixes (including FreeBSD):

      You may need to replace fdatasync() with fsync() in jk_util.c.

      The build-hpux-cc.sh script should be modifiable for IRIX and AIX.  Edit the script and change the APACHE_HOME and JAVA_HOME locations as required.


      If you are using EAPI, try adding -DEAPI to the apxs command after mod_jk.so.

      If apxs fails with apxs:Break: Command failed with rc=255, it may have been damaged by mod_ssl. Search for:

      my $CFG_LD_SHLIB      = q();          # substituted via Makefile.tmpl
      my $CFG_LDFLAGS_SHLIB = q(); # substituted via Makefile.tmpl

      and change to:

      my $CFG_LD_SHLIB      = q(ld);          # substituted via Makefile.tmpl
      my $CFG_LDFLAGS_SHLIB = q(-G); # substituted via Makefile.tmpl

      If you've installed Java in another directory, adjust accordingly.

      For other Unixes you should be able to work it out, but remember that the order of the arguments to apxs is important!.

  6. Now, copy the mod_jk library.  # cp mod_jk.so $APACHE_HOME/libexec. (Note that the build scripts attempt to do this, but you may have to su first.)

Other Webservers

There are several Makefiles in the other directories under the TOMCAT_HOME/native/mod_jk/ directory.  You should also check the Tomcat documentation for specific information related to other web servers.


Configuring Apache

This section details the configuration that is required for the Apache Web Server to support mod_jk.

Removing mod_jserv directives

If you've previously configured Apache to use mod_jserv, remove any ApJServMount directives from your httpd.conf. If you're including tomcat-apache.conf or tomcat.conf, you'll want to remove them as well - they are specific to mod_jserv.  The mod_jserv configuration directives are not compatible with mod_jk!

Configure Apache to use mod_jk

The simplest way to configure Apache to use mod_jk is to turn on the Apache auto-configure setting in Tomcat and put the following include directive at the end of your Apache httpd.conf file (make sure you replace TOMCAT_HOME with the correct path for your Tomcat installation:

Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto

Example:

Include /usr/local/jakarta-tomcat/conf/jk/mod_jk.conf-auto

This will tell Apache to use directives in the mod_jk.conf-auto file in the Apache configuration.  This file is created by enabling the Apache auto-configuration as described in the configuring Tomcat section below [Configuring Tomcat].

NOTE:  If you plan to use the Tomcat-Apache auto-configuration, skip the rest of this section and continue with the Configuring Tomcat section.

Custom configurations can be created by enabling the auto-configuration and copying the TOMCAT_HOME/conf/jk/mod_jk.conf-auto file to your own configuration file, such as TOMCAT_HOME/conf/jk/mod_jk.conf-local.

The basic configuration is as follows:

  • You will need to instruct Apache to load Tomcat. This can be done with Apache's LoadModule and AddModule configuration directives.
  • You must inform mod_jk the location of your workers.properties file. Use mod_jk's JkWorkersFile configuration directive.
  • You should specify a location where mod_jk is going to place its log file and a log level to be used. Use the JkLogFile and JkLogLevel configuration directives. Possible log levels are debug, info, error and emerg, but info should be your default selection.
  • The directive JkLogStampFormat will configure the date/time format found on mod_jk logfile. Using strftime() format string it's set by default to "[%a %b %d %H:%M:%S %Y] "
A simple example would be to include the following lines in your httpd.conf file:
LoadModule    jk_module  libexec/mod_jk.so
AddModule mod_jk.c
JkWorkersFile /usr/local/jakarta-tomcat/conf/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

Assigning URLs to Tomcat

If you have created a custom or local version of mod_jk.conf-local as noted above, you can change settings such as the workers or URL prefix.

Use mod_jk's JkMount directive to assign specific URLs to Tomcat. In general the structure of a JkMount directive is:

JkMount <URL prefix> <Worker name>

For example the following directives will send all requests ending in .jsp or beginning with /servlet to the "ajp13" worker, but jsp requests to files located in /otherworker will go to "remoteworker".

JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /otherworker/*.jsp remoteworker
You can use the JkMount directive at the top level or inside <VirtualHost> sections of your httpd.conf file.

Configuring Tomcat

Enabling Tomcat's Apache Auto-Config

In most simple cases Tomcat can generate the needed Apache configuration. You can configure Tomcat so that when it starts up it will automatically generate a configuration file for Apache to use mod_jk. Most of the time you don't need to do anything but include this file (appending "Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto") in your httpd.conf, as shown in the previous section (Configuring Apache).

To configure Tomcat to generate the Apache auto-configuration add the following block to your TOMCAT_HOME/conf/server.xml file after <AutoWebApp ... />.

<ApacheConfig />

That's it, you can now start Tomcat and Apache and access Tomcat from the Apache server.

Note: Settings for mod_jk auto-configuration is new in Tomcat 3.3.  Older versions of Tomcat create the auto-config file without a directive in server.xml.  The new directive in Tomcat 3.3 allows for additional configuration options as detailed later in this section.  For older versions of Tomcat, refere to the documentation that came with that version.

If you have special needs, for example mounting URL prefixes that are not the default, you can use this file as a base for your customized configuration and save the results in another file. If you manage the Apache configuration yourself you'll need to update it whenever you add a new context.

Note that you must restart tomcat and apache after adding a new context; Apache doesn't support configuration changes without a restart. Also the file TOMCAT_HOME/conf/jk/mod_jk.conf-auto is generated when tomcat starts, so you'll need to start Tomcat before Apache. Tomcat will overwrite TOMCAT_HOME/conf/jk/mod_jk.conf-auto each startup so customized configuration should be kept elsewhere.  For example, copy  TOMCAT_HOME/conf/jk/mod_jk.conf-auto to TOMCAT_HOME/conf/jk/mod_jk.conf-local before making changes.  You'll need to startup Tomcat once to generate this file with your configuration for the first time.

It is also possible to specify the location of the auto generated files by setting options in the <ApacheConfig /> block.  The following details the syntax:

< ContextManager ... >
...
<ApacheConfig options />
...
< /ContextManager >

 where options can include any of the following attributes:

  • confighome - default parent directory for the following paths. If not set, this defaults to TOMCAT_HOME. Ignored whenever any of the following paths is absolute.
  • jservconfig - path to write apache jserv conf file to. If not set, defaults to "conf/jserv/tomcat-apache.conf".
  • jkconfig - path to write apacke mod_jk conf file to. If not set, defaults to "conf/jk/mod_jk.conf".
  • workersconfig - path to workers.properties file used by mod_jk. If not set, defaults to "conf/jk/workers.properties".
  • modjserv - path to Apache JServ plugin module file. If not set, defaults to "modules/ApacheModuleJServ.dll" on windows, "modules/Jserv.nlm" on netware, and "libexec/mod_jserv.so" everywhere else.
  • modjk - path to Apache mod_jk plugin file. If not set, defaults to "modules/mod_jk.dll" on windows, "modules/mod_jk.nlm" on netware, and "libexec/mod_jk.so" everywhere else.
  • jklog - path to log file to be used by mod_jk.

 Example:

...

<AutoWebApp dir="webapps" host="DEFAULT" />

<ApacheConfig confighome="/home/mydir" />

...

(Optional) Configuring Tomcat to use the Ajpv13 protocol

mod_jk can use either the original Ajpv12 protocol or the newer Ajpv13 protocol. Both protocols are enabled by default. The "Ajp13" Connection Handler in Tomcat will give you the benefit of a faster protocol and the ability to identify requests made via HTTPS.

The following block enables Ajpv13 in your TOMCAT_HOME/conf/server.xml file.
<RequestInterceptor
className="org.apache.tomcat.modules.server.Ajp13Interceptor"
port="8009"/>

The server.xml file already has a block similar to this for Ajp12 connections on port 8007 (as delivered by mod_jserv). Even if you think you're only using Ajp13, you probably don't want to delete this connector -- it's required to shut down Tomcat.

(Optional) Defining "workers"

Configuring workers manually.

Workers are configured using the file TOMCAT_HOME/conf/jk/workers.properties. There is a great deal of information in the workers.properties howto document, and you should really look at that first. If you're in a hurry however, you can probably get away with editing the file workers.properties and setting the workers.tomcat_home, workers.java_home and ps variables to the correct values for your system.


Example Configuration

Here's an example configuration which probably reflects many real-world setups. A site is using Tomcat and Apache with two virtual hosts (one of them using HTTPS as well, which we're assuming is being handled by mod_ssl).

URLs ending in .jsp and beginning with /servlet are handled by Tomcat, the rest are handled by Apache. The files for each Host are server out of /web/host1 and /web/host2 respectively.

The example are over-simplified and incomplete but should get you started. Also note the virtual host setup is new in Tomcat 3.2 - this example won't work with Tomcat 3.1.

.
.
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
<Parameter name="port" value="8007"/>
</Connector>

<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
<Parameter name="port" value="8009"/>
</Connector>

<Host name="host1.apache.org">
<Context path="" docBase="/web/host1" debug="0"/>
</Host>
<Host name="host2.apache.org">
<Context path="" docBase="/web/host2" debug="0"/>
</Host>
.
.
Table 1 - Excerpt from server.xml showing the Ajp13 Connector and two virtual hosts.

# Setup for Solaris system
#
workers.tomcat_home=/usr/local/jakarta-tomcat
workers.java_home=/usr/java
ps=/
worker.list=ajp12, ajp13

# Definition for Ajp13 worker (Ajp12 left to readers imagination)
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
Table 2 - Excerpt from workers.properties showing the Ajp13 worker

# Load mod_jk
#
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c

# Configure mod_jk
#
JkWorkersFile /usr/local/jakarta-tomcat/conf/jk/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel info

# First Virtual Host.
#
<VirtualHost 10.0.0.1:80>
DocumentRoot /web/host1
ServerName host1.apache.org
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
</VirtualHost>

# Second Virtual Host. Also accessible via HTTPS
#
<VirtualHost 10.0.0.2:80>
DocumentRoot /web/host2
ServerName host2.apache.org
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
</VirtualHost>

<VirtualHost 10.0.0.2:443>
DocumentRoot /web/host2
ServerName host2.apache.org
SSLEngine On
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
</VirtualHost>

Table 3 - Excerpt from Apaches httpd.conf showing JK directives.

Troubleshooting and F.A.Q.s

Q. Where can I get help/support for mod_jk?

A. The primary mechanism for support is through the Tomcat Documentation included in the TOMCAT_HOME/doc directory.  These documents are viewable via browser through Tomcat http://localhost:8080/doc/index.html.  Documentation is also available on the Apache Jakarta web site for Tomcat at http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html.

For additional help, the best resource is the Tomcat Users Discussion list.  You should start by searching the mail list archives located at http://mikal.org/interests/java/tomcat/index.html before you post questions to the list.  If you are unable to locate the answer to your question in the archive, you can post questions about Tomcat or mod_jk to the user list for assistance.  Make sure that you include the version of Apache and Tomcat that you are using as well as the platform you are running on. http://jakarta.apache.org/site/mail.html

Q. I can't find mod_jk anywhere. Where is it?

A. Starting with Tomcat 3.3, the source for mod_jk is included in the native/mod_jk directory.  You can also download the Source Distribution of Tomcat to obtain the source for mod_jk, which is how it was obtained in versions prior to Tomcat 3.3. The Binary Distributions of mod_jk are available at the same location as the Binary Distribution of Tomcat.  The mod_jk binaries are located in subdirectories by platform. But in May 2001, the jakarta-tomcat-connectors was started and you'll find here up to date featured mod_jk (ie: new protocols AJP14/WARP)

Q. Which protocol should I use? Ajp12 or Ajp13?

A. Ajp13 is a newer protocol, it's faster, and it works better with SSL. You almost certainly want to use it. There is more information in the workers.properties howto document.

Q. Whenever I restart Tomcat, Apache locks up!

A. The Ajp13 protocol keeps an open socket between Tomcat and Apache. The latest release of mod_jk (the one found since Tomcat 3.3-m2 and J-T-C) handle the network failure. But with previous release of mod_jk, you may have to restart Apache as well.

Q. Why did exist two files mod_jk.so (-eapi ad -noeapi) in download dir for Linux ?

A. Many versions of Apache use of modified API, known at Extended API. For example, Apache using mod_ssl or Apache present in certains recent Linux distributions. So if you got such 'Extended Apache', you need to use mod_jk.so-eapi, or use mod_jk.so-noeapi for standard Apache. It's wise to avoid using EAPI modules on STD API Apache or to use standard API modules on EAPI Apache. Allways be sure to have the mod_jk.so for your version of Apache

Q. What's that message about 'garbled DSO ?'

A. It's related to Apache EAPI, the message 'mod_jk.so is garbled - perhaps this is not an Apache module DSO ?' just told you are trying to install a mod_jk.so DSO module that was compiled on an Apache using EAPI, like apache-mod_ssl or apache from Redhat distro 6.2/7.0 but your system use the standard apache with normal API.

Q. And the message about 'module might crash under EAPI! '

A. Also related to EAPI, the message '[warn] Loaded DSO /usr/lib/apache/mod_jk.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)', the mod_jk.so was compiled under normal Apache with standard API and you try to install the module on an Apache using EAPI.

Q. Where can I get more information?

A. The workers.properties howto document has considerably more in-depth information than this one, and is worth a look. You could also try searching the mailing list archives for "mod_jk" or look at the source.

Q. APXS is getting an error during the build of mod_jk, like rc=0 or rc=255.  I tried all of the steps in the build section, what do I do now?

A. APXS is a Perl script that is created when you build the Apache web server from source.  Chances are that if you are getting these errors and you obtained Apache as a binary distribution, that APXS is not configured correctly for your system.  Your best bet is to get the Apache source from http://httpd.apache.org and build it yourself.  Use the following for a basic build (read the Apache docs for other options):
# cd /usr/local/src
# gzip -dc apache_1.3.19.tar.gz|tar xvf -
# cd apache_1.3.19
# ./configure --prefix=/usr/local/apache "
--enable-module=most "
--enable-shared=max
# make
# make install

Note: The above steps assume that you downloaded the Apache source and placed it in your /usr/local/src directory.


Credits

This document was originally created by Gal Shachor

Revisions by (Alphabetical)

Mike Braden <mikeb@mwbinc.com>
Mike Bremford
Chris Pepper

With help from countless others on the tomcat-dev and tomcat-user lists!

Copyright ©1999-2001 The Apache Software Foundation
Legal Stuff They Make Us Say
Contact Information



seal 2008-07-17 22:01 鍙戣〃璇勮
]]>
Tomcat-Apache HOWTOhttp://www.tkk7.com/sealyu/archive/2008/07/17/215545.htmlsealsealThu, 17 Jul 2008 08:56:00 GMThttp://www.tkk7.com/sealyu/archive/2008/07/17/215545.htmlhttp://www.tkk7.com/sealyu/comments/215545.htmlhttp://www.tkk7.com/sealyu/archive/2008/07/17/215545.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/215545.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/215545.html闃呰鍏ㄦ枃

seal 2008-07-17 16:56 鍙戣〃璇勮
]]>
The Apache Tomcat Connector - Webserver HowTohttp://www.tkk7.com/sealyu/archive/2008/07/17/215541.htmlsealsealThu, 17 Jul 2008 08:51:00 GMThttp://www.tkk7.com/sealyu/archive/2008/07/17/215541.htmlhttp://www.tkk7.com/sealyu/comments/215541.htmlhttp://www.tkk7.com/sealyu/archive/2008/07/17/215541.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/215541.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/215541.html闃呰鍏ㄦ枃

seal 2008-07-17 16:51 鍙戣〃璇勮
]]>
tomcat5.5涓嬮厤緗甿anager鐢ㄦ埛鍚嶅瘑鐮?/title><link>http://www.tkk7.com/sealyu/archive/2008/07/17/215540.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Thu, 17 Jul 2008 08:48:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/07/17/215540.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/215540.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/07/17/215540.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/215540.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/215540.html</trackback:ping><description><![CDATA[鍦╰omcat-users.xml涓坊鍔狅細<br /> <role rolename="manager"/><br /> <role rolename="admin"/><br /> <br /> <user username="admin" password="admin" roles="admin,manager"/> <img src ="http://www.tkk7.com/sealyu/aggbug/215540.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-07-17 16:48 <a href="http://www.tkk7.com/sealyu/archive/2008/07/17/215540.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Redhat linux as 4涓夾pache涓巘omcat鏁村悎http://www.tkk7.com/sealyu/archive/2008/07/17/215507.htmlsealsealThu, 17 Jul 2008 07:24:00 GMThttp://www.tkk7.com/sealyu/archive/2008/07/17/215507.htmlhttp://www.tkk7.com/sealyu/comments/215507.htmlhttp://www.tkk7.com/sealyu/archive/2008/07/17/215507.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/215507.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/215507.html 2.鍦╝pache緗戠珯涓嬭澆jk鏂囦歡 mod_jk_1.2.25_http_2.0.59.so錛屽皢璇ユ枃浠舵嫹鍏pache鐨勫畨瑁呯洰褰曚笅鐨刴odules鐩綍涓嬨?
淇敼apache瀹夎鐩綍涓嬬殑httpd_conf鏂囦歡錛?
LoadModule jk_module modules/ mod_jk_1.2.25_http_2.0.59.so
JkWorkersFile “Conf/workers.properties”
JkLogFile “logs/mod_jk.log
JkLogLevel debug
JkMount /*.jsp worker1
JkMount /test/* worker1

Listen 192.168.0.1:80

DocumentRoot “/web/tomcat5028/webapps/test”
<Directory “/web/tomcat5028/webapps/test”>
鍦╟onf涓嬪緩绔媤orkers.properties鏂囦歡錛岄敭鍏ヤ互涓嬪唴瀹癸細
ps=/
worker. .list = worker1
worker.worker1.typye = ajp13
worker.worker1.host = 192.168.0.1
worker.worker1.port = 8009
worker.worker1.lbfactor = 1
鏈鍚庢祴璇曪紝閲嶅惎Tomcat鏈嶅姟鍣ㄥ拰Apache鏈嶅姟鍣紝閫氳繃IE璁塊棶http://192.168.0.1/濡傛灉鍑虹幇
Tomcat鐨勯粯璁や富欏碉紝琛ㄦ槑閰嶇疆浠ユ垚鍔熴?

seal 2008-07-17 15:24 鍙戣〃璇勮
]]>
Apache HTTP Server 涓?Tomcat 鐨勪笁縐嶈繛鎺ユ柟寮忎粙緇?/title><link>http://www.tkk7.com/sealyu/archive/2008/07/16/215337.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Wed, 16 Jul 2008 14:41:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/07/16/215337.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/215337.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/07/16/215337.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/215337.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/215337.html</trackback:ping><description><![CDATA[<blockquote>鏁村悎 Apache Http Server 鍜?Tomcat 鍙互鎻愬崌瀵歸潤鎬佹枃浠剁殑澶勭悊鎬ц兘銆佸埄鐢?Web 鏈嶅姟鍣ㄦ潵鍋氳礋杞藉潎琛′互鍙婂閿欍佹棤緙濈殑鍗囩駭搴旂敤紼嬪簭銆傛湰鏂囦粙緇嶄簡涓夌鏁村悎 Apache 鍜?Tomcat 鐨勬柟寮忋?/blockquote> <p>棣栧厛鎴戜滑鍏堜粙緇嶄竴涓嬩負浠涔堣璁? Apache 涓?Tomcat 涔嬮棿榪涜榪炴帴銆備簨瀹炰笂 Tomcat 鏈韓宸茬粡鎻愪緵浜?HTTP 鏈嶅姟錛岃鏈嶅姟榛樿鐨勭鍙f槸 8080錛岃濂? tomcat 鍚庨氳繃 8080 绔彛鍙互鐩存帴浣跨敤 Tomcat 鎵榪愯鐨勫簲鐢ㄧ▼搴忥紝浣犱篃鍙互灝嗚绔彛鏀逛負 80銆?/p> <p>鏃㈢劧 Tomcat 鏈韓宸茬粡鍙互鎻愪緵榪欐牱鐨勬湇鍔★紝鎴戜滑涓轟粈涔堣繕瑕佸紩鍏?Apache 鎴栬呭叾浠栫殑涓浜涗笓闂ㄧ殑 HTTP 鏈嶅姟鍣ㄥ憿錛熷師鍥犳湁涓嬮潰鍑犱釜錛?/p> <p>1. 鎻愬崌瀵歸潤鎬佹枃浠剁殑澶勭悊鎬ц兘</p> <p>2. 鍒╃敤 Web 鏈嶅姟鍣ㄦ潵鍋氳礋杞藉潎琛′互鍙婂閿?/p> <p>3. 鏃犵紳鐨勫崌綰у簲鐢ㄧ▼搴?/p> <p>榪? 涓夌偣瀵逛竴涓?web 緗戠珯鏉ヨ鏄潪甯鎬箣閲嶈鐨勶紝鎴戜滑甯屾湜鎴戜滑鐨勭綉绔欎笉浠呮槸閫熷害蹇紝鑰屼笖瑕佺ǔ瀹氾紝涓嶈兘鍥犱負鏌愪釜 Tomcat 瀹曟満鎴栬呮槸鍗囩駭紼嬪簭瀵艱嚧鐢ㄦ埛璁塊棶涓嶄簡錛岃岃兘瀹屾垚榪欏嚑涓姛鑳界殑銆佹渶濂界殑 HTTP 鏈嶅姟鍣ㄤ篃灝卞彧鏈?apache 鐨?http server 浜嗭紝瀹冭窡 tomcat 鐨勭粨鍚堟槸鏈绱у瘑鍜屽彲闈犵殑銆?/p> <p>鎺ヤ笅鏉ユ垜浠粙緇嶄笁縐嶆柟娉曞皢 apache 鍜?tomcat 鏁村悎鍦ㄤ竴璧楓?/p> <p><a name="N1005F">JK</a></p> <p>榪欐槸鏈甯歌鐨勬柟寮忥紝浣犲彲浠ュ湪緗戜笂鎵懼埌寰堝鍏充簬閰嶇疆JK鐨勭綉欏碉紝褰撶劧鏈鍏ㄧ殑榪樻槸鍏跺畼鏂規(guī)墍鎻愪緵鐨勬枃妗c侸K 鏈韓鏈変袱涓増鏈垎鍒槸 1 鍜?2錛岀洰鍓?1 鏈鏂扮殑鐗堟湰鏄?1.2.19錛岃岀増鏈?2 鏃╁凡緇忓簾寮冧簡錛屼互鍚庝笉鍐嶆湁鏂扮増鏈殑鎺ㄥ嚭浜嗭紝鎵浠ュ緩璁綘閲囩敤鐗堟湰 1銆?/p> <p>JK 鏄氳繃 AJP 鍗忚涓?Tomcat 鏈嶅姟鍣ㄨ繘琛岄氳鐨勶紝Tomcat 榛樿鐨?AJP Connector 鐨勭鍙f槸 8009銆侸K 鏈韓鎻愪緵浜嗕竴涓洃鎺т互鍙婄鐞嗙殑欏甸潰 jkstatus錛岄氳繃 jkstatus 鍙互鐩戞帶 JK 鐩墠鐨勫伐浣滅姸鎬佷互鍙婂鍒?tomcat 鐨勮繛鎺ヨ繘琛岃緗紝濡備笅鍥炬墍紺猴細</p> <br /> <a name="N1006D"><strong>鍥?1錛氱洃鎺т互鍙婄鐞嗙殑欏甸潰 jkstatus</strong></a><br /> <img alt="鍥?1錛氱洃鎺т互鍙婄鐞嗙殑欏甸潰 jkstatus" src="http://www.ibm.com/developerworks/cn/opensource/os-lo-apache-tomcat/images/image002.jpg" border="0" height="228" width="554" /> <br /> <p>鍦? 榪欎釜鍥句腑鎴戜滑鍙互鐪嬪埌褰撳墠JK閰嶄簡涓や釜榪炴帴鍒嗗埆鍒?8109 鍜?8209 绔彛涓婏紝鐩墠 s2 榪欎釜榪炴帴鏄仠姝㈢姸鎬侊紝鑰?s1 榪欎釜榪炴帴鑷笂嬈¢噸鍚悗宸茬粡澶勭悊浜?47 涓囧涓姹傦紝嫻侀噺杈懼埌 6.2 涓?G錛屾渶澶х殑騫跺彂鏁版湁 13 絳夌瓑銆傛垜浠篃鍙互鍒╃敤 jkstatus 鐨勭鐞嗗姛鑳芥潵鍒囨崲 JK 鍒頒笉鍚岀殑 Tomcat 涓婏紝渚嬪灝?s2 鍚敤錛屽茍鍋滅敤 s1錛岃繖涓湪鏇存柊搴旂敤紼嬪簭鐨勬椂鍊欓潪甯告湁鐢紝鑰屼笖鏁翠釜鍒囨崲榪囩▼瀵圭敤鎴鋒潵璇存槸閫忔槑鐨勶紝涔熷氨杈懼埌浜嗘棤緙濆崌綰х殑鐩殑銆傚叧浜?JK 鐨勯厤緗枃绔犵綉涓婂凡緇忛潪甯稿浜嗭紝榪欓噷鎴戜滑涓嶅啀璇︾粏鐨勪粙緇嶆暣涓厤緗繃紼嬶紝浣嗘垜瑕佽涓涓嬮厤緗殑鎬濊礬錛屽彧瑕佹槑鐧戒簡閰嶇疆鐨勬濊礬錛孞K 灝辨槸涓涓潪甯哥伒媧葷殑緇勪歡銆?/p> <p>JK 鐨勯厤緗渶鍏抽敭鐨勬湁涓変釜鏂囦歡錛屽垎鍒槸 </p> <p> <strong>httpd.conf </strong> <br /> Apache 鏈嶅姟鍣ㄧ殑閰嶇疆鏂囦歡錛岀敤鏉ュ姞杞?JK 妯″潡浠ュ強鎸囧畾 JK 閰嶇疆鏂囦歡淇℃伅</p> <p> <strong>workers.properties</strong> <br /> 鍒?Tomcat 鏈嶅姟鍣ㄧ殑榪炴帴瀹氫箟鏂囦歡</p> <p> <strong>uriworkermap.properties</strong> <br /> URI 鏄犲皠鏂囦歡錛岀敤鏉ユ寚瀹氬摢浜?URL 鐢?Tomcat 澶勭悊錛屼綘涔熷彲浠ョ洿鎺ュ湪 httpd.conf 涓厤緗繖浜?URI錛屼絾鏄嫭绔嬭繖浜涢厤緗殑濂藉鏄?JK 妯″潡浼氬畾鏈熸洿鏂拌鏂囦歡鐨勫唴瀹癸紝浣垮緱鎴戜滑淇敼閰嶇疆鐨勬椂鍊欐棤闇閲嶆柊鍚姩 Apache 鏈嶅姟鍣ㄣ?/p> <p>鍏朵腑絎簩銆佷笁涓厤緗枃浠跺悕閮藉彲浠ヨ嚜瀹氫箟銆備笅闈㈡槸涓涓吀鍨嬬殑 httpd.conf 瀵?JK 鐨勯厤緗?/p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre># (httpd.conf)<br /> # 鍔犺澆 mod_jk 妯″潡<br /> LoadModule jk_module modules/mod_jk.so<br /> <br /> #<br /> # Configure mod_jk<br /> #<br /> <br /> JkWorkersFile conf/workers.properties<br /> JkMountFile conf/uriworkermap.properties<br /> JkLogFile logs/mod_jk.log<br /> JkLogLevel warn<br /> </pre> </td> </tr> </tbody> </table> <br /> <p>鎺ヤ笅鏉ユ垜浠湪 Apache 鐨?conf 鐩綍涓嬫柊寤轟袱涓枃浠跺垎鍒槸 workers.properties銆乽riworkermap.properties銆傝繖涓や釜鏂囦歡鐨勫唴瀹瑰ぇ姒傚涓?/p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre>#<br /> # workers.properties<br /> #<br /> <br /> <br /> # list the workers by name<br /> <br /> worker.list=DLOG4J, status<br /> <br /> # localhost server 1<br /> # ------------------------<br /> worker.s1.port=8109<br /> worker.s1.host=localhost<br /> worker.s1.type=ajp13<br /> <br /> # localhost server 2<br /> # ------------------------<br /> worker.s2.port=8209<br /> worker.s2.host=localhost<br /> worker.s2.type=ajp13<br /> worker.s2.stopped=1<br /> <br /> worker.DLOG4J.type=lb<br /> worker.retries=3<br /> worker.DLOG4J.balanced_workers=s1, s2<br /> worker.DLOG4J.sticky_session=1<br /> <br /> worker.status.type=status<br /> </pre> </td> </tr> </tbody> </table> <br /> <p>浠ヤ笂鐨?workers.properties 閰嶇疆灝辨槸鎴戜滑鍓嶉潰閭d釜灞忓箷鎶撳浘鐨勯〉闈㈡墍鐢ㄧ殑閰嶇疆銆傞鍏堟垜浠厤緗簡涓や釜綾誨瀷涓?ajp13 鐨?worker 鍒嗗埆鏄?s1 鍜? s2錛屽畠浠寚鍚戝悓涓鍙版湇鍔″櫒涓婅繍琛屽湪涓や釜涓嶅悓绔彛 8109 鍜?8209 鐨?Tomcat 涓娿傛帴涓嬫潵鎴戜滑閰嶇疆浜嗕竴涓被鍨嬩負 lb錛堜篃灝辨槸璐熻澆鍧囪 鐨勬剰鎬濓級鐨?worker錛屽畠鐨勫悕瀛楁槸 DLOG4J錛岃繖鏄竴涓昏緫鐨?worker錛屽畠鐢ㄦ潵綆$悊鍓嶉潰閰嶇疆鐨勪袱涓墿鐞嗚繛鎺?s1 鍜?s2銆傛渶鍚庤繕閰嶇疆浜嗕竴涓被鍨嬩負 status 鐨?worker錛岃繖鏄敤鏉ョ洃鎺?JK 鏈韓鐨勬ā鍧椼傛湁浜嗚繖涓変釜 worker 榪樹笉澶燂紝鎴戜滑榪橀渶瑕佸憡璇?JK錛屽摢浜?worker 鏄彲鐢ㄧ殑錛屾墍浠ュ氨鏈?<strong>worker.list = DLOG4J, status</strong> 榪欒閰嶇疆銆?/p> <p>鎺ヤ笅鏉ヤ究鏄?URI 鐨勬槧灝勯厤緗簡錛屾垜浠渶瑕佹寚瀹氬摢浜涢摼鎺ユ槸鐢?Tomcat 澶勭悊鐨勶紝鍝簺鏄敱 Apache 鐩存帴澶勭悊鐨勶紝鐪嬬湅涓嬮潰榪欎釜鏂囦歡浣犲氨鑳芥槑鐧藉叾涓厤緗殑鎰忎箟</p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre>/*=DLOG4J<br /> /jkstatus=status<br /> <br /> !/*.gif=DLOG4J<br /> !/*.jpg=DLOG4J<br /> !/*.png=DLOG4J<br /> !/*.css=DLOG4J<br /> !/*.js=DLOG4J<br /> !/*.htm=DLOG4J<br /> !/*.html=DLOG4J<br /> </pre> </td> </tr> </tbody> </table> <br /> <p>鐩鎬俊浣犲凡緇忔槑鐧戒簡涓澶у崐浜嗭細鎵鏈夌殑璇鋒眰閮界敱 DLOG4J 榪欎釜 worker 榪涜澶勭悊錛屼絾鏄湁鍑犱釜渚嬪錛?jkstatus 璇鋒眰鐢?status 榪欎釜 worker 澶勭悊銆傚彟澶栬繖涓厤緗腑姣忎竴琛屾暟鎹墠闈㈢殑鎰熷徆鍙鋒槸浠涔堟剰鎬濆憿錛熸劅鍙瑰彿琛ㄧず鎺ヤ笅鏉ョ殑 URI 涓嶈鐢?JK 榪涜澶勭悊錛屼篃灝辨槸 Apache 鐩存帴澶勭悊鎵鏈夌殑鍥劇墖銆乧ss 鏂囦歡銆乯s 鏂囦歡浠ュ強闈欐?html 鏂囨湰鏂囦歡銆?/p> <p> 閫氳繃瀵?workers.properties 鍜?uriworkermap.properties 鐨勯厤緗紝鍙互鏈夊悇縐嶅悇鏍風(fēng)殑緇勫悎鏉ユ弧瓚蟲垜浠墠闈㈡彁鍑哄涓涓?web 緗戠珯鐨勮姹傘傛?zhèn)ㄤ笉濡ㄥ姩鎵嬭瘯璇曞Q?/p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" height="1" width="100%" /><br /> <img alt="" src="http://www.ibm.com/i/c.gif" border="0" height="6" width="8" /></td> </tr> </tbody> </table> <table align="right" cellpadding="0" cellspacing="0"> <tbody> <tr align="right"> <td><img src="http://www.ibm.com/i/c.gif" alt="" height="4" width="100%" /><br /> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" alt="" border="0" height="16" width="16" /><br /> </td> <td align="right" valign="top"><a class="fbox"><strong>鍥為〉棣?/strong></a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <br /> <br /> <p><a name="N100CB">http_proxy</a></p> <p>榪欐槸鍒╃敤 Apache 鑷甫鐨?mod_proxy 妯″潡浣跨敤浠g悊鎶鏈潵榪炴帴 Tomcat銆傚湪閰嶇疆涔嬪墠璇風(fēng)‘淇濇槸鍚︿嬌鐢ㄧ殑鏄?2.2.x 鐗堟湰鐨?Apache 鏈嶅姟鍣ㄣ傚洜涓?2.2.x 鐗堟湰瀵硅繖涓ā鍧楄繘琛屼簡閲嶅啓錛屽ぇ澶х殑澧炲己浜嗗叾鍔熻兘鍜岀ǔ瀹氭с?/p> <p>http_proxy 妯″紡鏄熀浜?HTTP 鍗忚鐨勪唬鐞嗭紝鍥犳瀹冭姹?Tomcat 蹇呴』鎻愪緵 HTTP 鏈嶅姟錛屼篃灝辨槸璇村繀欏誨惎鐢?Tomcat 鐨?HTTP Connector銆備竴涓渶綆鍗曠殑閰嶇疆濡備笅</p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre>ProxyPass /images !<br /> ProxyPass /css !<br /> ProxyPass /js !<br /> ProxyPass / http://localhost:8080/<br /> </pre> </td> </tr> </tbody> </table> <br /> <p>鍦ㄨ繖涓厤緗腑錛屾垜浠妸鎵鏈? http://localhost 鐨勮姹備唬鐞嗗埌 http://localhost:8080/ 錛岃繖涔熷氨鏄?Tomcat 鐨勮闂湴鍧錛岄櫎浜? images銆乧ss銆乯s 鍑犱釜鐩綍闄ゅ銆傛垜浠悓鏍峰彲浠ュ埄鐢?mod_proxy 鏉ュ仛璐熻澆鍧囪 錛屽啀鐪嬬湅涓嬮潰榪欎釜閰嶇疆</p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre>ProxyPass /images !<br /> ProxyPass /css ! <br /> ProxyPass /js !<br /> <br /> ProxyPass / balancer://example/<br /> <Proxy balancer://example/><br /> BalancerMember http://server1:8080/<br /> BalancerMember http://server2:8080/<br /> BalancerMember http://server3:8080/<br /> </Proxy><br /> </pre> </td> </tr> </tbody> </table> <br /> <p>閰嶇疆姣?JK 綆鍗曞浜嗭紝鑰屼笖瀹冧篃鍙互閫氳繃涓涓〉闈㈡潵鐩戞帶闆嗙兢榪愯鐨勭姸鎬侊紝騫跺仛涓浜涚畝鍗曠殑緇存姢璁劇疆銆?/p> <br /> <a name="N100F1"><strong>鍥?2錛氱洃鎺ч泦緹よ繍琛岀姸鎬?/strong></a><br /> <img alt="鍥?2錛氱洃鎺ч泦緹よ繍琛岀姸鎬? src="http://www.ibm.com/developerworks/cn/opensource/os-lo-apache-tomcat/images/image004.gif" border="0" height="427" width="553" /> <br /> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" height="1" width="100%" /><br /> <img alt="" src="http://www.ibm.com/i/c.gif" border="0" height="6" width="8" /></td> </tr> </tbody> </table> <table align="right" cellpadding="0" cellspacing="0"> <tbody> <tr align="right"> <td><img src="http://www.ibm.com/i/c.gif" alt="" height="4" width="100%" /><br /> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" alt="" border="0" height="16" width="16" /><br /> </td> <td align="right" valign="top"><a class="fbox"><strong>鍥為〉棣?/strong></a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <br /> <br /> <p><a name="N10101">ajp_proxy</a></p> <p>ajp_proxy 榪炴帴鏂瑰紡鍏跺疄璺?http_proxy 鏂瑰紡涓鏍鳳紝閮芥槸鐢?mod_proxy 鎵鎻愪緵鐨勫姛鑳姐傞厤緗篃鏄竴鏍鳳紝鍙渶瑕佹妸 http:// 鎹㈡垚 ajp:// 錛屽悓鏃惰繛鎺ョ殑鏄?Tomcat 鐨?AJP Connector 鎵鍦ㄧ殑绔彛銆備笂闈緥瀛愮殑閰嶇疆鍙互鏀逛負錛?/p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <pre>ProxyPass /images !<br /> ProxyPass /css ! <br /> ProxyPass /js !<br /> <br /> ProxyPass / balancer://example/<br /> <Proxy balancer://example/><br /> BalancerMember ajp://server1:8080/<br /> BalancerMember ajp://server2:8080/<br /> BalancerMember ajp://server3:8080/<br /> </Proxy><br /> </pre> </td> </tr> </tbody> </table> <br /> <p>閲囩敤 proxy 鐨勮繛鎺ユ柟寮忥紝闇瑕佸湪 Apache 涓婂姞杞芥墍闇鐨勬ā鍧楋紝mod_proxy 鐩稿叧鐨勬ā鍧楁湁 mod_proxy.so銆乵od_proxy_connect.so銆乵od_proxy_http.so銆乵od_proxy_ftp.so銆? mod_proxy_ajp.so錛?鍏朵腑 mod_proxy_ajp.so 鍙湪 Apache 2.2.x 涓墠鏈夈傚鏋滄槸閲囩敤 http_proxy 鏂瑰紡鍒欓渶瑕佸姞杞?mod_proxy.so 鍜?mod_proxy_http.so錛涘鏋滄槸 ajp_proxy 鍒欓渶瑕佸姞杞? mod_proxy.so 鍜?mod_proxy_ajp.so榪欎袱涓ā鍧椼?/p> <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" height="1" width="100%" /><br /> <img alt="" src="http://www.ibm.com/i/c.gif" border="0" height="6" width="8" /></td> </tr> </tbody> </table> <table align="right" cellpadding="0" cellspacing="0"> <tbody> <tr align="right"> <td><img src="http://www.ibm.com/i/c.gif" alt="" height="4" width="100%" /><br /> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" alt="" border="0" height="16" width="16" /><br /> </td> <td align="right" valign="top"><a class="fbox"><strong>鍥為〉棣?/strong></a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <br /> <br /> <p><a name="N10116">涓夎呮瘮杈?/a></p> <p>鐩? 瀵逛簬 JK 鐨勮繛鎺ユ柟寮忥紝鍚庝袱縐嶅湪閰嶇疆涓婃槸姣旇緝綆鍗曠殑錛岀伒媧繪ф柟闈篃涓鐐歸兘涓嶉婅壊銆備絾灝辯ǔ瀹氭ц岃█灝變笉鍍?JK 榪欐牱涔呯粡鑰冮獙錛屾瘯绔?Apache 2.2.3 鎺ㄥ嚭鐨勬椂闂村茍涓嶉暱錛岄噰鐢ㄨ繖縐嶈繛鎺ユ柟寮忕殑緗戠珯榪樹笉澶氾紝鍥犳錛屽鏋滄槸搴旂敤浜庡叧閿殑浜掕仈緗戠綉绔欙紝榪樻槸寤鴻閲囩敤 JK 鐨勮繛鎺ユ柟寮忋?/p> <br /> <br /> <p><a name="resources">鍙傝冭祫鏂?</a></p> <ul> <li> 鑾峰緱 <a >Apache Http Server</a>銆? <br /> <br /> </li> <li> 鑾峰緱 <a >Apache Tomcat</a>銆? <br /> <br /> </li> <li> <a >JK 鏂囨。</a>銆? </li> </ul> <br /> <br /> <p><a name="author">鍏充簬浣滆?/a></p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td colspan="3"><img alt="" src="http://www.ibm.com/i/c.gif" height="5" width="100%" /></td> </tr> <tr align="left" valign="top"> <td><br /> </td> <td><img alt="" src="http://www.ibm.com/i/c.gif" height="5" width="4" /></td> <td width="100%"> <p>鍒樺啲錛屼竴鐩翠嬌鐢?J2EE/J2ME 浠庝簨縐誨姩浜掕仈緗戞柟闈㈢殑寮鍙戙傛?zhèn)ㄥ彲浠ラ氳繃 Java 鑷敱浜虹綉绔欐潵璺熶粬鑱旂郴錛岀綉鍧鏄細<a >http://www.dlog.cn/javayou</a> 錛屽彟澶栦粬鐨勯偖浠跺湴鍧鏄?a href="mailto:javayou@gmail.com?cc=">javayou@gmail.com</a>銆?/p> </td> </tr> </tbody> </table> <img src ="http://www.tkk7.com/sealyu/aggbug/215337.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-07-16 22:41 <a href="http://www.tkk7.com/sealyu/archive/2008/07/16/215337.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title> JBoss 4.0.4GA 鍚姩鍙傛暟瑙i噴(杞澆)http://www.tkk7.com/sealyu/archive/2008/04/10/191991.htmlsealsealThu, 10 Apr 2008 14:29:00 GMThttp://www.tkk7.com/sealyu/archive/2008/04/10/191991.htmlhttp://www.tkk7.com/sealyu/comments/191991.htmlhttp://www.tkk7.com/sealyu/archive/2008/04/10/191991.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/191991.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/191991.html     -V, --version                                               鏄劇ず鐗堟湰淇℃伅
      -D<name>[=<value>]                            璁劇疆緋葷粺灞炴?br />     -d, --bootdir=<dir>                                   璁劇疆鍚姩琛ヤ竵鐩綍鐨勪綅緗紱蹇呴』鏄粷瀵硅礬寰勬垨鑰卽rl
    -p, --patchdir=<dir>                                 璁劇疆琛ヤ竵鐩綍鐨勪綅緗紱蹇呴』鏄粷瀵硅礬寰勬垨鑰卽rl
    -n, --netboot=<url>                                  浠庢寚瀹氱殑url緗戠粶浣嶇疆鍚姩
    -c, --configuration=<name>                  鎸囧畾鏈嶅姟鍣ㄥ惎鍔ㄧ殑閰嶇疆錛坉efault銆乤ll銆乵inimal錛?br />     -B, --bootlib=<filename>                        灝嗗叾瀹冪殑jar鍖呮坊鍔犲埌bootclasspath鐨勫墠闈?br />     -L, --library=<filename>                         灝嗗叾瀹冪殑jar鍖呮坊鍔犲埌 loaders classpath
    -C, --classpath=<url>                            灝嗗叾瀹冪殑url娣誨姞鍒發(fā)oaders classpath
    -P, --properties=<url>                           浠庢寚瀹氱殑url鍔犺澆緋葷粺灞炴?br />     -b, --host=<host or ip>                          鎵鏈塉Boss Service緇戝畾鐨勫湴鍧
    -g, --partition=<name>                          HA鍒嗗尯鐨勫悕縐幫紙緙虹渷涓篋efaultDomain錛?br />     -u, --udp=<ip>                                         UDP鐨勫鎾湴鍧
    -l, --log=<log4j|jdk>                                璁劇疆鏃ュ織璁板綍鎻掍歡綾誨瀷

JBoss 4.0.4GA鐜鍙橀噺

    JBOSS_HOME                                        JBoss鐨勪綅緗?br />     JAVA                                                         Java榪愯紼嬪簭鐨勪綅緗?br />     JAVA_OPTS                                            JVM鍚姩鍙傛暟
    MAX_FD                                                  JBoss鑳藉浣跨敤鏂囦歡鎻忚堪絎︾殑鏈澶ф暟閲忥紙浠呯敤浜嶶n*x錛?/p>

seal 2008-04-10 22:29 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 日韩在线视频线视频免费网站| 国产伦精品一区二区三区免费下载 | 亚洲另类自拍丝袜第五页| **实干一级毛片aa免费| 亚洲人成依人成综合网| 日本视频免费高清一本18| 日韩亚洲欧洲在线com91tv| 两个人日本免费完整版在线观看1| 亚洲午夜爱爱香蕉片| 四虎影视在线看免费观看| 亚洲AV中文无码乱人伦在线视色| 国产精品亚洲AV三区| 国产成人精品123区免费视频| 国产AV无码专区亚洲AV蜜芽| 在线观看亚洲免费视频| www亚洲精品久久久乳| 免费a级黄色毛片| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 337P日本欧洲亚洲大胆精品| 国产男女性潮高清免费网站| 国产99久久亚洲综合精品| 亚洲成av人片天堂网老年人| 亚洲一级片免费看| 国产亚洲综合色就色| 免费A级毛片在线播放| 91亚洲性爱在线视频| 久久精品免费一区二区喷潮| 亚洲国产成人久久精品大牛影视| 国产免费131美女视频| 无码毛片一区二区三区视频免费播放 | 成人亚洲网站www在线观看| 永久免费精品影视网站| 亚洲色大成网站www永久一区 | 国产精品高清全国免费观看| 污污视频网站免费观看| 国产成人麻豆亚洲综合无码精品| 日韩电影免费在线观看中文字幕| 亚洲国产精品线在线观看| 男女免费观看在线爽爽爽视频| 亚洲国产精品无码第一区二区三区| 免费一级做a爰片性色毛片|