1.安装JDK
- 下载压缩源码:jdk-8u181-linux-x64.tar.gz
- 解压源码:tar -zxvf jdk-8u181-liunx-x64.tar.gz
- 移动到/usr/local/jdk:mv jdk-8u181-liunx-x64 /usr/local/jdk
- jdk配置:
打开系统的环境变量配置文件:vi /etc/profile
在profile文件最后加入:## JAVA
export JAVA_HOME=/usr/local/jdk
export PATH=$PATH:$JAVA_HOME/bin
- 验证配置:java -version
2.安装Tomcat
- 下载压缩源码:apache-tomcat-8.5.34.tar.gz
- 解压源码:tar -zxvf apache-tomcat-8.5.34.tar.gz
- 移动到/usr/local/tomcat:mv apache-tomcat-8.5.34 /usr/local/tomcat
- 配置快捷启动(软连接):
ln -s /usr/local/tomcat/bin/startup.sh /usr/local/bin/tomcat-start
ln -s /usr/local/tomcat/bin/shutdown.sh /usr/local/bin/tomcat-stop