debian 9安装openjdk,tomcat以及开机启动tomcat的方法
安装jdk1.8
apt-get install openjdk-8-jdk
安装tomcat 8
1
2
3
4
5
6
7
8
useradd -m -U -d /opt/tomcat -s /bin/false tomcat
//添加运行用户
cd /tmp
wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.51/bin/apache-tomcat-8.5.51.zip
unzip apache-tomcat-*.zip
mv apache-tomcat-*/ /opt/tomcat
chown -R tomcat: /opt/tomcat
chmod +x /opt/tomcat/latest/bin/*.sh
开机启动tomcat 8
添加新的/etc/rc.local
文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cat <<EOF >/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/bin/su -s /bin/bash -c "/opt/tomcat/bin/startup.sh" tomcat
exit 0
EOF
exit 0
之前即可
也可以写成独立启动脚本
1
2
#!/bin/bash
/bin/su -s /bin/bash -c "/opt/tomcat/bin/startup.sh" tomcat
chmod +x /etc/rc.local
systemctl start rc-local
💘 相关文章
- debian /ubuntu系统安装测速软件的方法
- Debian 10 更换163源并安装Java 8和maven记录
- debian 10安装MySQL服务器记录
- Create Debian minimal with Hyper-V
- 转载:Debian制作Cloud-Init的pve系统模版
- debian 12安装pve出现/etc/pve/local/pve-ssl.key: failed to load错误的解决方法
- debian系统安装国产web服务器kangle的记录,
- Debian 10 how to turn IPv6 on and off
- debian/Ubuntu系统超级简单的防火墙配置
- debian安装docker和Docker面板Portainer并部署Wordpress