搭建环境
192.168.64.135 nginx
192.168.64.136 Tomcat
192.168.64.140 Tomcat
安装Tomcat 同时要安装Java
自行百度下载安装吧
Java环境变量
JAVA_HOME=/usr/local/java
JRE_HOME=/usr/local/java/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
我Java安装目录是/usr/local/java
Tomcat安装目录是/usr/local/tomcat/tomcat8080
顺便给一个启动Tomcat脚本 名称tomcat
#!/bin/bash
# description: Tomcat8 Start Stop Restart
# processname: tomcat8
# chkconfig: 2345 21 80
JAVA_HOME=/usr/local/java
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
CATALINA_HOME=/usr/local/tomcat/tomcat8080
export PATH
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
启动服务
service tomcat start
192.168.64.136
192.168.64.140