Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1074936
  • 博文数量: 120
  • 博客积分: 887
  • 博客等级: 准尉
  • 技术积分: 1883
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-05 21:10
个人简介

RHCE,CCNA,熟悉shell脚本

文章分类

全部博文(120)

文章存档

2015年(16)

2014年(20)

2013年(48)

2012年(20)

2011年(16)

分类: 系统运维

2013-08-29 13:38:47

多公网端口下的tomcat-http跳转到tomcat-https

http:
内网端口---8088
外网端口---3002

https:
内网端口---8089
外网端口---3003



------------------------------------------------------------------生成证书----------------------------------------------
Linux环境
条件:安装了JDK
步骤:
l  进入$JAVA_HOME/bin目录
l  执行命令
./keytool -genkey -alias tomcat -keyalg RSA -keystore /usr/local/web/tomcat.keystore -validity 36500
参数简要说明:“/etc/tomcat.keystore”含义是将证书文件保存在路径/usr/local/web/下,证书文件名称是tomcat.keystore ;“-validity 36500”含义是证书有效期,36500表示100年,默认值是90天
l  在命令行填写必要的参数:
A、Enter keystore password:此处需要输入大于6个字符的字符串
B、“What is your first and last name?”这是必填项,并且必须是TOMCAT部署主机的域名或者IP[如:xxx.com 或者 192.168.4.xx],就是你将来要在浏览器中输入的访问地址
C、“What is the name of your organizational unit?”、“What is the name of your organization?”、“What is the name of your City or Locality?”、“What is the name of your State or Province?”、“What is the two-letter country code for this unit?”可以按照需要填写也可以不填写直接回车,在系统询问“correct?”时,对照输入信息,如果符合要求则使用键盘输入字母“y”,否则输入“n”重新填写上面的信息
D、Enter key password for ,这项较为重要,会在tomcat配置文件中使用,建议输入与keystore的密码一致,设置其它密码也可以
  完成上述输入后,直接回车则在你在第二步中定义的位置找到生成的文件

-------------------------------------------------------------------------------

vi /tomcat/conf/server.xml
               connectionTimeout="20000"
               redirectPort="3003" URIEncoding="UTF-8"/>  

               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" keystoreFile="icity.keystore"                 //放在apache-tomcat-6.0.36
     keystorePass="i123@163.com" sslProtocol="TLS" />                 //必须是mail地址
    



vi /tomcat/conf/web.xml

       
           SSL
           /login.jsp                           //拦截login.jsp页面
           /userAction/loginInit.action          //拦截loginInit.action页面
           /userAction/registerInit.action       //拦截registerInit.action页面
       

       
           CONFIDENTIAL
       

       


阅读(3194) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~