标签:base server less bash har 调整 strong home serve
基础环境及JDK就不多说了,下面的目录结构以如下为准:
根目录-apps
根目录-apps--tomcat
根目录-apps--ins1
根目录-apps--ins2
=========================
1、目录调整:创建以上目录
2、目录调整:安装tomcat到apps/tomcat目录
3、目录调整:移动tomcat下的所有目录(除lib、bin 2个目录)到ins1/ 以及ins2/
以ins1为示例:
1、进入到ins1目录下,创建bin目录
2、创建startup.sh shutdown.sh两个文件,并赋予执行权限
脚本内容分别如下:
startup.sh
#!/bin/bash export JRE_HOME=/usr/local/java/jdk1.8.0_191/jre export CATALINA_HOME=/apps/tomcat export CATALINA_BASE="/apps/ins1" export CATALINA_TMPDIR="$CATALINA_BASE/temp" export CATALINA_PID="$CATALINA_BASE/bin/tomcat.pid" export JAVA_OPTS="-server -Xms1024m -Xmx1024m -Djava.awt.headless=true -Dtomcat.name=tomcat1" #创建logs目录 if [ ! -d "$CATALINA_BASE/logs" ]; then mkdir $CATALINA_BASE/logs fi #创建temp目录 if [ ! -d "$CATALINA_BASE/temp" ]; then mkdir $CATALINA_BASE/temp fi bash $CATALINA_HOME/bin/startup.sh "$@"
shutdown.sh
# 调用tomcat启动脚本 #!/bin/bash export JRE_HOME=/usr/local/java/jdk1.8.0_191/jre export CATALINA_HOME=/apps/tomcat export CATALINA_BASE="/apps/ins1" export CATALINA_TMPDIR="$CATALINA_BASE/temp" export CATALINA_PID="$CATALINA_BASE/bin/tomcat.pid" bash $CATALINA_HOME/bin/shutdown.sh "$@"
~
标签:base server less bash har 调整 strong home serve
原文地址:https://www.cnblogs.com/fan-yuan/p/10008905.html