7. 使用密码认证方式进行连接,不但可以提高安全性,而且可以对用户的权限进行设置。如果不使用密码认证的方式,则无法对用户的权限进行限制。
配置使用ssl进行加密连接
1. 在服务器上使用keytool创建密钥对
keytool是java平台自带的一个密钥和证书管理工具,使用keytool创建密钥对:
keytool -genkey -alias tomcat -keystore /somepath/tomcatKeyStore
按照提示输入相关信息(包括设定密码、姓、组织名等),这些信息是可以随便输入的,但从产品角度讲应该统一设定。输入的密码在今后操作中均需要使用。
2. 导出公钥
keytool -export -alias tomcat -keystore /somepath/tomcatKeyStore -file /somepath/jconsole.cert
3. 将公钥导入至需要运行jconsole的机器。
keytool –import –alias jconsole –keystore /somepath/jconsoleKeyStore -file /somepath/jconsole.cert
4. 修改tomcat的catalina脚本
将-Dcom.sun.management.jmxremote.ssl="false"修改为:
-Dcom.sun.management.jmxremote.ssl="true",并在 JA_OPTS变量行添加:
-Djavax.net.ssl.keyStore=/somepath/jconsoleKeyStore
-Djavax.net.ssl.keyStorePassword=设定的密码
6. 填入主机名、用户、口令连接服务器。
其他问题
1. 在执行shutdown.sh或者shutdown.bat脚本关闭tomcat时出现如下错误,tomcat无法关闭:
错误: 代理抛出异常: java.rmi.server.ExportException: Port already in use: 9004;
nested exception is:
java.net.BindException: Address already in use: JVM_Bind
出错原因:JA_OPT变量设置的参数未放置于本文档中指定位置。
(转)!CF84914AA1F284FD!336.entry
本篇以 Client 端想監控 Resin Server 的目的,分享如何監控遠端的 Server 其 JVM 使用狀況,
以下為Client端設定方式:
PS: shell 不代表一定是 win32 或是 Linux 懂意思就好…
編輯 jmxremote.password 這個檔案,把
前面兩個#消掉
然後執行你電腦上面 jdk/bin 裡面的 jconsole.exe
輸入要連線的 IP 以及 port
username = monitorRole
password = QED
這帳號也是有權限的
controlRole 是 rw
monitorRole 是 readonly
Client 端設定結束。
Server 端 resin.conf 新增如下:
-Dcom.sun.management.jmxremote.port=7000
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
如此重啟 Resin 後即可監控。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-44302-10.html
制裁美国