1. 程式人生 > >設定linux開機啟動多個tomcat

設定linux開機啟動多個tomcat

1.分別配置tomcat的catalina.sh 的tomcat home

#   CATALINA_HOME   May point at your Catalina "build" directory.
#
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.
CATALINA_HOME=/opt/apache/apache-tomcat-2
CATALINA_BASE=/opt/apache/apache-tomcat-2

2.加入開機啟動命令, tomcat的注意的要加入 java home的路徑,

上面兩條是資料庫和nginx的開機啟動命令, nginx的路徑根據實際情況配置

vi /etc/rc.local
service mysqld start
/usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf
export JAVA_HOME=/usr/local/src/jdk1.8.0_151
export JRE_HOME=$JAVA_HOME/jre
sh /opt/apache/apache-tomcat-1/bin/startup.sh
sh /opt/apache/apache-tomcat-2/bin/startup.sh