Linux部署springboot项目

环境CentOS7,阿里云服务器

安装jdk.

把后台打jar包放到服务器上.我放在/opt下了.

使用命令启动:

nohup java -jar xxx.jar &

第一次在服务器上部署springboot项目会报错.需要重定向.生成的nohup.out文件不要删除!!!

重定向命令:(在/opt目录下会出现nuhup.out)

nohup ./nohup.out > /opt 2>/opt &

需再次启动jar,命令:

nohup java -jar xxx.jar &

使用命令:
ps aux | grep java

能看到jar包启动,证明启动成功.

有个问题未解决:nohup: ignoring input and appending output to ‘nohup.out’,不过,不影响项目运行.

参考文章:

https://blog.csdn.net/albertfly/article/details/78712249   nohup重定向

猜你喜欢

转载自blog.csdn.net/mqingo/article/details/83897742
今日推荐