新机器没有java环境:
sudo apt-get update #没有包资源时执行
sudo apt-get install openjdk-8-jdk #服务对jvm版本没有明显要求,就装个openjdk
开启ssh-root登录:
vim /etc/ssh/sshd_config
PermitRootLogin yes #允许root登录
重启ssh服务:
systemctl restart ssh
service ssh restart #两条皆可
配置服务自启动:
/etc/rc.local #编辑
增加:
nohup java -jar /root/*****.jar >/root/catalina.out &
修改IP和DNS:
vim /etc/network/interfaces
改为: auto eth0 #开机自动连接网络
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static #static表示使用固定ip,dhcp表述使用动态ip
address 10.10.10.155 #设置ip地址
netmask 255.255.255.0 #设置子网掩码
gateway 10.10.10.2 #设置网关
dns-nameservers 8.8.8.8 #指定DNS,直接配置/etc/resolv.conf,因其动态创建,重启会丢失配置