1. 官网地址
1.1 Tomcat下载地址
1.2 JDK下载地址
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2.部署tomcat
2.1 安装jdk8
1 | [admin@xfyun-bj-tools1 admin]$ tar xf downloads/jdk-8u192-linux-x64.tar.gz |
2.2 安装配置supervisor
这里我使用supervisor来管理tomcat进程
1 | [admin@xfyun-bj-tools1 admin]$ sudo pip install supervisor |
配置superviosr开机启动
1 | [admin@xfyun-bj-tools1 admin]$ sudo vim /usr/lib/systemd/system/supervisord.service |
1 | [admin@xfyun-bj-tools1 admin]$ sudo systemctl enable supervisord |
2.3 supervisor添加tomcat子进程
supervisor.conf配置文件添加以下tomcat相关配置
1 | [program:tomcat] |
2.4 启动supervisor
1 | sudo systemctl start supervisord |
这样直接使用会报错:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
解决方法:
修改tomcat目录下bin/catalina.sh 文件添加JAVA_HOME,JRE_HOME的环境变量
1 | export JAVA_HOME=/work/admin/jdk1.8.0 |