centos6.5下java和tomcat环境部署
软件包:
tomcat安装包 apache-tomcat-7.0.67.zip
jdk安装包 jdk-6u10-linux-x64.bin
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u10-oth-JPR
1.安装jdk
# cp jdk-6u10-linux-x64.bin /usr/local/jdk-6u10-linux-x64.bin
# cd /usr/local/
# chmod +x jdk-6u10-linux-x64.bin# ./jdk-6u10-linux-x64.bin
2.安装tomcat并配置生效
# unzip apache-tomcat-7.0.67.zip# cp -r apache-tomcat-7.0.67 /usr/local/
# cd /usr/local/apache-tomcat-7.0.67/bin/
在 catalina.sh文件 最顶添加如下内容
export TOMCAT_HOME=/usr/local/apache-tomcat-7.0.67
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.67
export JRE_HOME=/usr/local/jdk1.6.0_10/jre
export JAVA_HOME=/usr/local/jdk1.6.0_10
然后执行 source catalina.sh 让配置生效
3.添加.sh文件的执行权限
# cd /usr/local/apache-tomcat-7.0.67/bin/# chmod 777 *.sh
启动tomcat
/usr/local/apache-tomcat-7.0.67/bin/startup.sh
关闭tomcat
/usr/local/apache-tomcat-7.0.67/bin/shutdown.sh
==========================================
==========================================
openjdk1.8.0+tomcat7.0.61环境搭建
1.通过yum安装openjdk1.8.0
# yum install -y java-1.8.0-openjdk
通过rpm -ql命令查看安装的jdk路径
# rpm -ql java-1.8.0-openjdk
2. 下载tomcat7.0.61并解压到 /usr/local/tomcat7目录 下
# unzip apache-tomcat-7.0.67.zip
# cp -r apache-tomcat-7.0.67 /usr/local/tomcat7
# cd /usr/local/tomcat7/
3. 在 catalina.sh文件 最顶添加如下内容
# cd /usr/local/tomcat7/bin
对所有sh文件开放运行权限
# chmod 777 *.sh
export TOMCAT_HOME=/usr/local/tomcat7
export CATALINA_HOME=/usr/local/tomcat7
export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64
然后执行 source catalina.sh 让配置生效
4.启动和关闭tomcat
/usr/local/tomcat7/bin/startup.sh
/usr/local/tomcat7/bin/shutdown.sh