1.安装前准备
准备tomcat压缩包
jdk 压缩包
2.安装jdk
(1)解压即可
(2)用文本编辑器打开/etc/profile
·在profile文件末尾加入:
export JAVA_HOME=/usr/share/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
3.安装tomcat
解压即可
然后在浏览器输入:http://localhost:8080看看那只"猫"是否出来了.
4.配置SSL
注意,在jdk的bin 目录下
cd /usr/java/jdk1.6.0_32/bin ./keytool -genkey -alias tomcat -keyalg RSA -keystore /usr/local/tomcat/conf/.keystore
输入密码、提供你的信息即可.
5.修改tomcat配置文件
cd /usr/local/tomcat/conf/
vi server.xml
找到这一段:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" />
修改为:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" keystoreFile="/usr/local/tomcat6-ccms/conf/.keystore" keystorePass="你第四步生成SSL的密码" sslProtocol="TLS" />
6.重启tomcat
/usr/local/tomcat/bin/shutdown.sh /usr/local/tomcat/bin/startup.sh
注意端口号是8443
防火墙开启8443端口,然后在浏览器输入:https://ip:8443/,好了可以安全的看到那只"猫"了.
时间: 2024-10-31 16:13:15