tomcat 安装
1.安装JDK
openjdk
oracle jdk
openjdk的安装方式:
1.yum install -y java-1.8.0-openjdk
2.下载 http://jdk.java.net/9/
tar zxvf openjdk-9.0.4_linux-x64_bin.tar.gz -C /usr/local/
cat << "EOF" > /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/local/jdk-9.0.4
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
EOF
source /etc/profile.d/jdk.sh
3.javac
oracle jdk安装方式:
1.下载 http://java.oracle.com/
2.rpm包安装
yum localinsall -y jdk-9.0.4_linux-x64_bin.rpm
tag.gz包安装
tar zxvf jdk-9.0.4_linux-x64_bin.tar.gz -C /usr/local/
cat << "EOF" > /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/local/jdk-9.0.4
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
EOF
source /etc/profile.d/jdk.sh
javac
2.安装tomcat
下载tomcat:http://tomcat.apache.org/
tar zxvf apache-tomcat-9.0.6.tar.gz -C /usr/local/
echo 'export PATH=/usr/local/apache-tomcat-9.0.6/bin:$PATH' > /etc/profile.d/tomcat.sh
source /etc/profile.d/tomcat.sh
启动tomcat:startup.sh