由于我在安装CentOS5.5的时候没有安装Java。在说Linux下的大部分都是自带OpenJDK,你懂的!嘿嘿。
Oracle提供Linux下的安装包有jdk-6u23-linux-i586.bin和jdk-6u23-linux-i586-rpm.bin,这两个都可以,下面我用jdk-6u23-linux-i586-rpm.bin安装
开始安装:
- # cd /usr
- # mkdir java
- //用Xftp把jdk-6u23-linux-i586-rpm.bin上传到/usr/java
- # cd /usr/java
- # ll
- # chmod +x ./jdk-6u23-linux-i586-rpm.bin
- # ./jdk-6u23-linux-i586-rpm.bin
- # rpm -qa | grep jdk
- jdk-1.6.0_23-fcs
- # vi /etc/profile
- //在这文件的最后加入如下代码
然后执行下面的命令:
- # cd /usr/
- # chmod +x ./apache-tomcat-6.0.29.zip
- # unzip ./apache-tomcat-6.0.29.zip
- # /usr/apache-tomcat-6.0.29/bin
- # chmod +x ./*.sh
- # ./startup.sh
查看openssl的版本:
- # openssl version
- OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
- //版本有点老。下篇在说升级的事。
- # cd /usr/
- # mkdir ./vanessl/
- # cd ./vanessl/
- # openssl genrsa -out ca-key.pem 1024
第二步,用CA去签发tomcat
- # keytool -genkey -alias tomcat_server -validity 365 -keyalg RSA -keysize 1024 -keystore server_keystore
- //Enter keystore password:123456
- //Re-enter new password:123456
- //What is your first and last name?
- // [Unknown]: 192.168.1.211
- //What is the name of your organizational unit?
- // [Unknown]: SoftWare
- //What is the name of your organization?
- // [Unknown]: Delochi
- //What is the name of your City or Locality?
- // [Unknown]: Kun Ming
- //What is the name of your State or Province?
- // [Unknown]: Yun Nan
- //What is the two-letter country code for this unit?
- // [Unknown]: CN
- //Is CN=192.168.1.211, OU=SoftWare, O=Delochi, L=Kun Ming, ST=Yun Nan, C=CN correct?
- // [no]: y
- //Enter key password for <tomcat_server>
- // (RETURN if same as keystore password):123456
- //Re-enter new password:123456
- # keytool -certreq -alias tomcat_server -sigalg MD5withRSA -file server.csr -keystore server_keystore
- //Enter keystore password:123456
- # openssl x509 -req -in server.csr -out server-cert.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -days 365
- //Signature ok
- //subject=/C=CN/ST=Yun Nan/L=Kun Ming/O=Delochi/OU=SoftWare/CN=192.168.1.211
- //Getting CA Private Key
- # keytool –import -v -trustcacerts -alias tomcat_server -file server-cert.pem -keystore server_keystore
- //Enter keystore password: 123456
- //Certificate reply was installed in keystore
- //[Storing server_keystore]
1、直接删除ROOT下面的所有文件,把直接的war包解压后放在里面(这种方式感觉太粗鲁,嘿嘿)
2、修改%TOMCAT_HOME%/conf/server.xml,在<HOST></HOST>标签里加入
- <Context path=“” docBase=“cas” debug=“0” reloadable=“true” />
- #path是说明虚拟目录的名字,如果你要只输入ip地址就显示主页,则该键值留为空;
- #docBase是虚拟目录的路径,它默认的是$tomcat/webapps/ROOT目录,现在我在webapps目录下建了一个myjsp目录,让该目录作为我的默认目录。
- #debug和reloadable一般都分别设置成0和true。