tornado 跑不通,小白求帮忙

2015-11-23 14:16:10 +08:00
 lydhr

Context :
- tornado 的 helloWorld 教程代码跑不通, localhost:8000 会报错‘未收到数据’

- 本机并未装 Nginx ,但是 0.0.0.0 打开后会显示 Welcome to nginx!那个欢迎页

- terminal 中, nginx command not found

Question :
- 如何定位自己的 nginx 转到哪里了?
- tornado 的 helloWorld 哪里不对?

5403 次点击
所在节点    Tornado
13 条回复
arbipher
2015-11-23 14:28:23 +08:00
本机肯定装 nginx 了。
0.0.0.0:8000 端口冲突了吗? tornado 换一个端口试试。
yongzhong
2015-11-23 14:31:20 +08:00
发个代码吧
gateswong
2015-11-23 14:33:40 +08:00
我觉得问题问得不对……

从你的问题看来实际上跟 Tornado 毛线关系都没有,检查一下你的防火墙, nginx 安装位置和配置文件什么的吧
Eleutherios
2015-11-23 14:46:11 +08:00
sudo netstat -ntplu
zhouzhe8013
2015-11-23 15:21:49 +08:00
啥机器,linux?mac?win?
tornado 不需要 nginx,先确定一下 tornado 有没有启动吧
然后看看端口占用
netstat -anpt|grep PID 或者端口
看看 tornado 在监听那个端口或者你想要的哪个端口被占了
ldehai
2015-11-23 17:02:58 +08:00
@lydhr 先别管 nginx 的事,首先看你的程序监听的什么端口,比如 8888 。
如果是的话,直接访问 localhost:8888 就行了
wingyiu
2015-11-24 00:08:47 +08:00
python server.py --port=9003
lsof -i:9003
lydhr
2015-11-26 16:08:51 +08:00
@arbipher 如何找到本机的 nginx 装在哪里了?
- 重启后访问 0.0.0.0 仍是 welcome to nginx 页面
- 用 chrome 审查元素抓到:
- Remote Address:127.0.0.1:1080
- Request URL:http://0.0.0.0/
- lsof -i:1080
`
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
IMRemoteU 517 lynn 5u IPv4 0x383a13600f203cc5 0t0 TCP localhost:61101->localhost:socks (CLOSE_WAIT)
IMRemoteU 517 lynn 12u IPv4 0x383a136006bc1225 0t0 TCP localhost:61100->localhost:socks (CLOSE_WAIT)
IMRemoteU 517 lynn 13u IPv4 0x383a136006f5f045 0t0 TCP localhost:61106->localhost:socks (CLOSE_WAIT)
`
lydhr
2015-11-26 16:10:41 +08:00
@arbipher 如何找到本机的 nginx 装在哪里了?
- 重启后访问 0.0.0.0 仍是 welcome to nginx 页面

- 用 chrome 审查元素抓到:
- Remote Address:127.0.0.1:1080
- Request URL:http://0.0.0.0/


- lsof -i:1080
`
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
IMRemoteU 517 lynn 5u IPv4 0x383a13600f203cc5 0t0 TCP localhost:61101->localhost:socks (CLOSE_WAIT)
IMRemoteU 517 lynn 12u IPv4 0x383a136006bc1225 0t0 TCP localhost:61100->localhost:socks (CLOSE_WAIT)
IMRemoteU 517 lynn 13u IPv4 0x383a136006f5f045 0t0 TCP localhost:61106->localhost:socks (CLOSE_WAIT)
`
arbipher
2015-11-26 16:20:35 +08:00
@lydhr
ps -ef | grep nginx
lydhr
2015-11-27 13:11:22 +08:00
@arbipher
$ ps -ef |grep nginx
501 1861 458 0 1:11 下午 ttys000 0:00.00 grep nginx
arbipher
2015-11-27 18:40:36 +08:00
@lydhr 是在下输了。搞不定。。。
lydhr
2015-12-02 09:45:58 +08:00
@arbipher anyway,thx a lot~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/238241

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX