Linux部署Django:报错 nohup: ignoring input and appending output to ‘nohup.out’
一、部署 Django 到远程 Linux 服务器
利用 xshell 通过 ssh 连接到 Linux服务器,常规的启动命令是
python3 manage.py runserver 0.0.0.0:
但是,关闭 xshell 后,就访问不了 Django 了。
这时候需要使用 nohup 命令启动(概念:如果你正在运行一个进程,而且你觉得在退出帐户时该进程还不会结束,那么可以使用nohup命令。该命令可以在你退出帐户/关闭终端之后继续运行相应的进程)
这时输入
nohup python3 manage.py runserver 0.0.0.0:
此时会报错
nohup: ignoring input and appending output to ‘nohup.out’
二、解决办法
1、原因
是因为使用 nohup 会产生日志文件,默认写入到 nohup.out
2、解决
将 nohup 的日志输出到 /dev/null,这个目录会让所有到它这的信息自动消失
nohup python3 manage.py runserver 0.0.0.0: > /dev/null > /dev/null &
Linux部署Django:报错 nohup: ignoring input and appending output to ‘nohup.out’的更多相关文章
- nohup 命令(设置后台进程): appending output to ‘nohup.out’ 问题
一.Linux 下使用 nohup Unix/Linux下一般比如想让某个程序在后台运行,很多都是使用 & 在程序结尾来让程序自动运行. 比如我们要运行weblogic在后台:./startW ...
- Django 报错 Reverse for 'content' not found. 'content' is not a valid view function or pattern name.
Django 报错 Reverse for 'content' not found. 'content' is not a valid view function or pattern name. 我 ...
- Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案
我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...
- Django报错:OSError: raw write() returned invalid length 4 (should have been between 0 and 2)
在使用Django时Django报错:Django报错:OSError: raw write() returned invalid length 4 (should have been between ...
- Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set.
Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and ...
- Linux QtCreator 编译报错:No rule to make target '.../***' needed by '***.o'.stop
Linux QtCreator 编译报错:No rule to make target 'mainwindow.cpp' needed by 'mainwindow.o'.stop [1]解决方案 ...
- 【jvm】linux 调用 jmap 报错Permission denied
linux 调用 jmap 报错Permission denied 解决方案: 分别对java安装目录,java的bin目录以及jmap命令设置权限 chmod jdk1..0_79 chmod b ...
- Linux常见英文报错中文翻译(菜鸟必知)
Linux常见英文报错中文翻译(菜鸟必知) 1.command not found 命令没有找到 2.No such file or directory 没有这个文件或目录 3.Permission ...
- Linux常见英文报错中文翻译
Linux常见英文报错中文翻译(菜鸟必知) 1.command not found 命令没有找到 2.No such file or directory 没有这个文件或目录 3.Permission ...
随机推荐
- 阻止移动端input按钮聚焦时唤起软键盘的方法
一.设置input为readonly 二.使用JS代码,在input按钮fous时就让其blur
- Spring switch的使用
首先在html开始标签中引入一个属性 1 xmlns:th="http://www.thymeleaf.org" 示例代码 <div th:switch="${us ...
- kindeditor 在JSP 中上传文件的配置
1.将kindeditor,jsp,lib目录下的jar文件放到工程的lib目录下 2.将admin-login.jsp,upload_json.jsp,复制到admin的files目录下 3.复制以 ...
- shell中变量的测试与替换
在某些时刻我们经常需要判断某个变量是否存在,若变量存在则使用既有的设置,若变量不存在则给予一个常用的设置. (1) 变量未被设置或者内容为空,则替换为新的内容. new_var=${old_var-c ...
- python查询neo4j的数据以字典的方式返回数据
在使用python操作neo4j的时候,如果查询的数据比较多,结构比较复杂的时候,返回的数据量会比较大,而且信息比较多,并且不唯一.所以写了该方法,用于查询比较复杂的数据. def query_gra ...
- Linux中实用的命令
1. 查看linux机器是32位还是64位的方法: 1.file /sbin/init 或者file /bin/ls (注意命令中的空格) /sbin/init: ELF64- ...
- 如何使用RedisTemplate访问Redis数据结构之字符串操作
Redis 数据结构简介 Redis 可以存储键与5种不同数据结构类型之间的映射,这5种数据结构类型分别为String(字符串).List(列表).Set(集合).Hash(散列)和 Zset(有序集 ...
- THUSC2013
魔塔 BZOJ 设每个敌人的属性值为\(hp_i,atk_i,def_i\).自己的为\(HP,ATK,DEF\) 首先我们可以发现顺序是没有影响的. 然后我们可以发现合适的\(ATK\)一定满足\( ...
- NOIP2012 DAY1 T2 国王游戏
题目描述 恰逢 H国国庆,国王邀请n 位大臣来玩一个有奖游戏.首先,他让每个大臣在左.右手上面分别写下一个整数,国王自己也在左.右手上各写一个整数.然后,让这 n 位大臣排成一排,国王站在队伍的最前面 ...
- linux fork进程请谨慎多个进程/线程共享一个 socket连接,会出现多个进程响应串联的情况。
昨天组内同学在使用php父子进程模式的时候遇到了一个比较诡异的问题 简单说来就是:因为fork,父子进程共享了一个redis连接.然后父子进程在发送了各自的redis请求分别获取到了对方的响应体. 复 ...