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 阅读(1125) |
评论 (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 阅读(473) |
评论 (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 阅读(3501) |
评论 (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 阅读(3589) |
评论 (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 阅读(1197) |
评论 (1) |
编辑 收藏