Linux部署Django:报错 nohup: ignoring input and appending output to ‘nohup.out’

1、部署 Django 到远程 Linux 服务器python

利用 xshell 经过 ssh 链接到 Linux服务器,常规的启动命令是shell

python3 manage.py runserver 0.0.0.0:80

可是,关闭 xshell 后,就访问不了 Django 了。服务器

这时候须要使用 nohup 命令启动(概念:若是你正在运行一个进程,并且你以为在退出账户时该进程还不会结束,那么可使用nohup命令。该命令能够在你退出账户/关闭终端以后继续运行相应的进程)app

这时输入ssh

nohup python3 manage.py runserver 0.0.0.0:80

此时会报错spa

nohup: ignoring input and appending output to ‘nohup.out’

 

2、解决办法日志

一、缘由code

是由于使用 nohup 会产生日志文件,默认写入到 nohup.outserver

二、解决blog

将 nohup 的日志输出到 /dev/null,这个目录会让全部到它这的信息自动消失

nohup python3 manage.py runserver 0.0.0.0:80 > /dev/null 2> /dev/null &
相关文章
相关标签/搜索