posts - 11,  comments - 18,  trackbacks - 0
            2007年11月8日
          使用continuum 構建項目,構建成功.
          [INFO] BUILD SUCCESSFUL

          但是我到E:\apache-continuum-1.1\continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\30\target
          下面查看continuum構建完之后的war包

          .war\WEB-INF\classes文件夾里沒有class文件,只有properties和xml配置文件
          posted @ 2008-08-26 09:14 dd.zhang 閱讀(1139) | 評論 (2)編輯 收藏

          step 1 : 生成server key
          使用java/kegtool工具
          keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore e:/server.keystore -validity 3600
          注:參數 -validity 指證書的有效期(天),缺省有效期很短,只有90天。

          step 2 : 將證書導入java證書信任庫,服務端和客戶端都必須導入證書
          分2步,第一步導出證書,第二步導入信任庫(tomcat為證書別名)
          keytool -export -trustcacerts -alias tomcat -file server.cer -keystore e:/server.keystore -storepass changeit
          keytool -import -trustcacerts -alias tomcat -file server.cer -keystore E:/Java/jdk1.6.0_03/jre/lib/security/cacerts -storepass changeit
          其他有用的keytool命令
          列表:keytool -list -v -keystore E:/Java/jre1.6.0_03/lib/security/cacerts
          刪除:keytool -delete -trustcacerts -alias tomcat -keystore E:/Java/jdk1.6.0_03/jre/lib/security/cacerts -storepass changeit
          注:E:/Java/jdk1.6.0_03/jre/lib/security/cacerts的JRE路徑和tomcat設置的E:\Java\jdk1.6.0_03\jre\bin\client\jvm.dll路徑相同

          step 3 : 配置tomcat server.xml,服務端和客戶端都必須配置
          tomcat6.0加入以下xml代碼
          <Connector protocol="org.apache.coyote.http11.Http11Protocol"
                     port="8443" minSpareThreads="5" maxSpareThreads="75"
                     enableLookups="true" disableUploadTimeout="true"
                     acceptCount="100"  maxThreads="200"
                     scheme="https" secure="true" SSLEnabled="true"
                     keystoreFile="e:/server.keystore" keystorePass="changeit"
                     clientAuth="false" sslProtocol="TLS"/>

           
          參考:
          http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

          posted @ 2008-01-22 17:17 dd.zhang 閱讀(479) | 評論 (0)編輯 收藏
          今天部署文件服務器集群時遇見一個奇怪的問題,服務器是windows2003,tomcat不能訪問網絡映射驅動器
          反復檢查多變,排除程序問題,那么問題就出在windows身上,2003的安全比較高,所以本身屏蔽了比較多的服務,而且對登錄程序的用戶也又限制.默認的登錄tomcat的帳戶應該是system用戶(沒有具體查證),本地帳戶不具有訪問網絡的權限.問題找到了.
          打開 服務管理,配置Tomcat服務屬性里的登錄帳戶,修改登錄帳戶為具有訪問網絡的帳戶(你可以修改為administrator試試).
          問題還沒有完全解決,tomcat只能通過\\192.168.0.202\files網絡路徑的形式訪問共享,不能通過網絡映射驅動器訪問(Y:\files)
          由于時間緊迫.所有沒有去研究windows2003哪個服務屏蔽administrator訪問網絡映射驅動器的權限.下次有時間再研究
          posted @ 2008-01-22 17:07 dd.zhang 閱讀(3507) | 評論 (4)編輯 收藏

          環境,兩臺主機 操作系統都是 window2003,主機A映射一個主機B的網絡磁盤
          在開發環境windows xp home版可以正常的往主機B的網絡磁盤寫文件
          拿到服務器上就完蛋,拋出異常java.io.FileNotFoundException
          拿同事的機器(同樣是home版)跑tomcat,也能正常寫.
          起初以為是系統登錄用戶的問題.兩臺主機都建立同樣的用戶和密碼,再測試還是失敗.
          換個方法建立域帳戶,把兩臺主機都加入到域里面,使用同樣域帳戶登陸主機,最后失敗中的失敗.
          實在搞不明白.如果不行就換linux了

          還做了一個測試,在主機A上寫了個普通的class,cmd java class執行,執行一個寫往主機B網絡磁盤寫文件的操作,可以寫過去,但是在tomcat環境下卻寫不過去..why....

          posted @ 2007-11-16 18:31 dd.zhang 閱讀(3600) | 評論 (8)編輯 收藏
          今天研究了下TOMCAT集群,遇到問題,望解答!  
          環境是一樣的2臺機器(下面用tomcat1,tomcat2來表示這兩臺機器)  
          按照官方網站的文檔配置,2個服務器都能正常起來。而且都監聽到了對方的存在,下面是輸出信息:  
          信息:       Verification       complete.       Member       disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://WDGJ-14:4001,WDGJ-14,4001,       alive=1608998,id={101       20       -85       1       -96       113       79       34       -116       24       -43       -93       27       -49       -87       44       },       payload={},       command={},       domain={},       ]]  
          web.xml的 <distributable/> 已經配置了

          使用同一個IE窗口訪問2個服務得到的SESSION       ID不同,在tomcat1保存一個session       attribute,在tomcat2上沒有,得到結果,配置失敗。SESSION沒有被復制到另一個服務。望高手幫幫忙!  
          我沒有做負載均衡,只做了集群。
          以下是tomcat官網上的原話,不知道是不是我沒理解明白,誰能再給說明下:
          1.All   your   session   attributes   must   implement   java.io.Serializable  
          2.Uncomment   the   Cluster   element   in   server.xml  
          If   you   have   defined   custom   cluster   valves,   make   sure   you   have   the   ReplicationValve   defined   as   well   under   the   Cluster   element   in   server.xml  
          3.If   your   Tomcat   instances   are   running   on   the   same   machine,   make   sure   the   tcpListenPort   attribute   is   unique   for   each   instance,   in   most   cases   Tomcat   is   smart   enough   to   resolve   this   on   it 's   own   by   autodetecting   available   ports   in   the   range   4000-4100  
          4.Make   sure   your   web.xml   has   the   <distributable/>   element   or   set   at   your   <Context   distributable= "true "   />  
          5.If   you   are   using   mod_jk,   make   sure   that   jvmRoute   attribute   is   set   at   your   Engine   <Engine   name= "Catalina "   jvmRoute= "node01 "   >   and   that   the   jvmRoute   attribute   value   matches   your   worker   name   in   workers.properties  
          6.Make   sure   that   all   nodes   have   the   same   time   and   sync   with   NTP   service!  
          7.Make   sure   that   your   loadbalancer   is   configured   for   sticky   session   mode.  

          兩個TOMCAT的server.xml唯一不同的地方就是Receiver的監聽端口,一個是4000一個是4001  
          server.xml文件如下:  
          <Server       port=   "8005   "       shutdown=   "SHUTDOWN   ">  
                  <Listener       className=   "org.apache.catalina.core.AprLifecycleListener   "       SSLEngine=   "on   "       />  
                  <Listener       className=   "org.apache.catalina.core.JasperListener   "       />  
                  <Listener       className=   "org.apache.catalina.mbeans.ServerLifecycleListener   "       />  
                  <Listener       className=   "org.apache.catalina.mbeans.GlobalResourcesLifecycleListener   "       />  

                  <GlobalNamingResources>  
                          <Resource       name=   "UserDatabase   "       auth=   "Container   "  
                                                                  type=   "org.apache.catalina.UserDatabase   "  
                                                                  description=   "User       database       that       can       be       updated       and       saved   "  
                                                                  factory=   "org.apache.catalina.users.MemoryUserDatabaseFactory   "  
                                                                  pathname=   "conf/tomcat-users.xml   "       />  
                  </GlobalNamingResources>  

                  <Service       name=   "Catalina   ">  
                          <Connector       port=   "80   "       protocol=   "HTTP/1.1   "      
                                                                      connectionTimeout=   "20000   "      
                                                                      redirectPort=   "8443   "       />  
                          <Connector       port=   "8009   "       protocol=   "AJP/1.3   "       redirectPort=   "8443   "       />  

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

              <Cluster       className=   "org.apache.catalina.ha.tcp.SimpleTcpCluster   "  
                                                              channelSendOptions=   "8   ">  

                                  <Manager       className=   "org.apache.catalina.ha.session.DeltaManager   "  
                                                                      expireSessionsOnShutdown=   "false   "  
                                                                      notifyListenersOnReplication=   "true   "/>  

                                  <Channel       className=   "org.apache.catalina.tribes.group.GroupChannel   ">  
                                          <Membership       className=   "org.apache.catalina.tribes.membership.McastService   "  
                                                                                          address=   "228.0.0.4   "  
                                                                                          port=   "45564   "  
                                                                                          frequency=   "500   "  
                                                                                          dropTime=   "3000   "/>  
                                          <Receiver       className=   "org.apache.catalina.tribes.transport.nio.NioReceiver   "  
                                                                                  address=   "auto   "  
                                                                                  port=   "4000   "  
                                                                                  autoBind=   "100   "  
                                                                                  selectorTimeout=   "5000   "  
                                                                                  maxThreads=   "6   "/>  

                                          <Sender       className=   "org.apache.catalina.tribes.transport.ReplicationTransmitter   ">  
                                                  <Transport       className=   "org.apache.catalina.tribes.transport.nio.PooledParallelSender   "/>  
                                          </Sender>  
                                          <Interceptor       className=   "org.apache.catalina.tribes.group.interceptors.TcpFailureDetector   "/>  
                                          <Interceptor       className=   "org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor   "/>  
                                  </Channel>  

                                  <Valve       className=   "org.apache.catalina.ha.tcp.ReplicationValve   "  
                                                              filter=   "   "/>  
                                  <Valve       className=   "org.apache.catalina.ha.session.JvmRouteBinderValve   "/>  

                                  <Deployer       className=   "org.apache.catalina.ha.deploy.FarmWarDeployer   "  
                                                                          tempDir=   "/tmp/war-temp/   "  
                                                                          deployDir=   "/tmp/war-deploy/   "  
                                                                          watchDir=   "/tmp/war-listen/   "  
                                                                          watchEnabled=   "false   "/>  

                                  <ClusterListener       className=   "org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener   "/>  
                                  <ClusterListener       className=   "org.apache.catalina.ha.session.ClusterSessionListener   "/>  
                          </Cluster>  

                                  <Realm       className=   "org.apache.catalina.realm.UserDatabaseRealm   "  
                                                              resourceName=   "UserDatabase   "/>  

                                  <Host       name=   "localhost   "           appBase=   "webapps   "  
                                                          unpackWARs=   "true   "       autoDeploy=   "true   "  
                                                          xmlValidation=   "false   "       xmlNamespaceAware=   "false   ">  

                                  </Host>  
                          </Engine>  
                  </Service>  
          </Server>  
          posted @ 2007-11-08 15:14 dd.zhang 閱讀(1205) | 評論 (1)編輯 收藏
          <2007年11月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 电白县| 莎车县| 河间市| 祁东县| 汝城县| 喀喇沁旗| 常德市| 潞城市| 虎林市| 汨罗市| 太康县| 新龙县| 大英县| 独山县| 九龙坡区| 镇原县| 永登县| 高陵县| 三台县| 红安县| 南阳市| 和林格尔县| 长垣县| 柏乡县| 阳原县| 望城县| 宝山区| 鲁甸县| 含山县| 滦平县| 金乡县| 永康市| 普格县| 临安市| 凭祥市| 佛学| 牙克石市| 沾化县| 兖州市| 龙州县| 崇信县|