1、下载jdk、tomcat并上传到服务器
2、安装jdk-7u79-linux-x64.rpm
[[email protected] ~]# cd /testdata/huangwenjiao/
[[email protected] huangwenjiao]# rpm -ivh jdk-7u79-linux-x64.rpm
Preparing... ########################################### [100%]
package jdk-2000:1.7.0_79-fcs.x86_64 is already installed
3、配置环境变量
向前翻页:ctrl+F
向后翻页:ctrl+B
JAVA_HOME=/testdata/huangwenjiao/jdk1.7.0_03
JRE_HOME=/testdata/huangwenjiao/jdk1.7.0_03/jre
JAVA_BIN=/testdata/huangwenjiao/jdk1.7.0_03/bin
#export JAVA_BIN=$JAVA_HOME$/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JRE_HOME JAVA_BIN PATH CLASSPAT
CATALINA_HOME=/usr/local/apache-tomcat-7.0.54/
保存退出
[[email protected] etc]# source /etc/profile
查看环境变量是否配置成功
[[email protected] etc]# java -version
4、解压安装apache-tomcat-7.0.54.tar.gz
解压:[[email protected] huangwenjiao]# tar -xzf apache-tomcat-7.0.54.tar.gz
移动到/usr/local/:[[email protected] huangwenjiao]# mv apache-tomcat-7.0.54 /usr/local/
[[email protected] local]# ln -s /usr/local/apache-tomcat-7.0.54/ /usr/local/tomcat/
[[email protected] huangwenjiao]# cd /usr/local/
[[email protected] local]# cd tomcat/bin/
[[email protected] bin]# vim catalina.sh
最后一行添加:TALINA_HOME=/usr/local/apache-tomcat-7.0.54/
在85行添加:
JAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Djava.awt.headless=true "
[[email protected] ~]# cd /usr/local/tomcat/bin/
[[email protected] bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /testdata/huangwenjiao/jdk1.7.0_03/jre
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
原文地址:https://www.cnblogs.com/LinxiHuang/p/9245881.html