Uwsgi: “无法分配请求的地址”
我有一个准备好的Django项目,然后我尝试通过这个命令使用uwsgi来启动它。
# uwsgi --http :5000 --module myProject.wsgi
结果出现了这个错误日志。
** Starting uWSGI 2.0.3 (32bit) on [Sun Apr 13 14:23:55 2014] ***
compiled with version: 4.6.3 on 13 April 2014 14:06:52
os: Linux-2.6.32-042stab078.26 #1 SMP Wed Jun 19 11:05:34 MSK 2013
nodename: vps
machine: i686
clock source: unix
detected number of CPU cores: 1
current working directory: /root/HomeworkTasker
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 191584
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Cannot assign requested address [core/socket.c line 759]
经过一些搜索,我发现有人说这个地址已经被占用了,但我确定并不是这样,原因有几个。第一个原因是,如果我进入Python的命令行,我可以手动绑定0.0.0.0:5000。另一个原因是,如果我使用netstat命令,5000端口并没有被列出。我能做些什么吗,还是说我没办法了?
1 个回答
-1
解决方案找到啦:
确保你的接口是正确的,可以通过运行下面的代码来检查:
ifconfig lo up