web页面出现Internal Server Error,查看错误日志提示: 2015/02/18 19:51:12 [error] 810#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: xx.xx.xx.xx, request: "GET / HTTP/1.1", upstream: "uwsgi://127.0.0.1:8000", host: "xx.xx.xx.xx"。求解所方法。
1
dingyaguang117 2015 年 2 月 20 日
uwsgi配置贴一下
|
2
surefire 2015 年 2 月 20 日
8000端口没开吧
|
4
ffx0s OP server {
listen 80; server_name 121.40.90.156; access_log /mydata/www/log/access.log; error_log /mydata/www/log/error.log; #charset koi8-r; #access_log logs/host.access.log main; location / { root /mydata/www; include uwsgi_params; # uwsgi_pass 127.0.0.1:9090; uwsgi_pass 127.0.0.1:8000; # uwsgi_param UWSGI_PYHOME /mydata/www/; # uwsgi_param UWSGI_SCRIPT /mydata/www/; # uwsgi_param UWSGI_CHDIR /mydata/www/; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location /static/ { alias /mydata/www/kisspy/static/; index index.html index.htm; } location /media/ { alias /mydata/www/kisspy/static/media/; } } |
5
ffx0s OP @dingyaguang117
<uwsgi> <socket>127.0.0.1:8000</socket> <listen>80</listen> <master>true</master> <pidfile>/var/run/nginx.pid</pidfile> <processes>8</processes> <pythonpath>/mydata/www</pythonpath> <module>wsgi</module> <profiler>true</profiler> <memory-report>true</memory-report> <enable-threads>true</enable-threads> <logdate>true</logdate> <limit-as>300</limit-as> <daemonize>/mydata/www/log/django.log</daemonize> </uwsgi> |
6
imlonghao 2015 年 2 月 20 日 via Android
<listen>80</listen>
|
7
ffx0s OP 主机是阿里云的。奇怪的是把磁盘快照回滚到环境部署好的。还是会出现这个问题。
|
8
imlonghao 2015 年 2 月 20 日 via Android
<pidfile>/var/run/nginx.pid</pidfile>
<listen>80</listen> uwsgi的配置为什么要这样写? |
9
imlonghao 2015 年 2 月 20 日 via Android
贴一下uwsgi的配置看看?
|
10
imlonghao 2015 年 2 月 20 日 via Android
更正,日志
|
11
imlonghao 2015 年 2 月 20 日 via Android
/mydata/www/log/django.log
|
12
tonghuashuai 2015 年 2 月 20 日
<daemonize>/mydata/www/log/django.log</daemonize> 这个地方用 uwsgi 自己的日志文件
<pidfile>/var/run/nginx.pid</pidfile> 这个地方不应该用 nginx.pid |
13
ffx0s OP @tonghuashuai <pidfile>/var/run/nginx.pid</pidfile>用什么?
|
14
ffx0s OP @imlonghao
django.log: {address space usage: 14348288 bytes/13MB} {rss usage: 4497408 bytes/4MB} [pid: 1340|app: -1|req: -1/22] 101.233.154.251 () {42 vars in 657 bytes} [Fri Feb 20 16:22:58 2015] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) Fri Feb 20 16:22:59 2015 - --- no python application found, check your startup logs for errors --- {address space usage: 14348288 bytes/13MB} {rss usage: 4497408 bytes/4MB} [pid: 1345|app: -1|req: -1/23] 101.233.154.251 () {44 vars in 737 bytes} [Fri Feb 20 16:22:59 2015] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) Fri Feb 20 16:22:59 2015 - --- no python application found, check your startup logs for errors --- {address space usage: 14348288 bytes/13MB} {rss usage: 4497408 bytes/4MB} [pid: 1347|app: -1|req: -1/24] 101.233.154.251 () {42 vars in 657 bytes} [Fri Feb 20 16:22:59 2015] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) |
15
dingyaguang117 2015 年 2 月 20 日 via iPhone
汗,楼主从哪儿抄的配置
|
16
msg7086 2015 年 2 月 20 日 via iPhone
<socket>127.0.0.1:8000</socket>
<listen>80</listen> <pidfile>/var/run/nginx.pid</pidfile> 我一个不懂python的人都知道这3句都有问题。 |
18
imlonghao 2015 年 2 月 20 日
no python application found, check your startup logs for errors
|
19
imlonghao 2015 年 2 月 20 日
我有理由相信你的 <module>wsgi</module> 配置错误
这是我的配置文件,您可以参考一下 https://github.com/esdcc/esd.cc/blob/master/esdcc.xml#L6 这一行所写的 ·wsgi· 对应的是 https://github.com/esdcc/esd.cc/blob/master/wsgi.py 测试如下,我将我的这个配置改成·<module>1213wsgi</module>· (一个没有对应文件的) 出现了和你类似的问题 500 ![]() Log ![]() |
20
imlonghao 2015 年 2 月 20 日
|
22
ffx0s OP @dingyaguang117 配置网上找的。对python感兴趣就学了。其实我是前端。。
|
23
ffx0s OP @dingyaguang117 网上抄的。
|
24
imlonghao 2015 年 2 月 20 日
|
25
tonghuashuai 2015 年 2 月 21 日
@ffx0s 新建一个 uwsgi.pid
|
26
surefire 2015 年 2 月 22 日
|
27
lsdvincent 2015 年 2 月 22 日
胆战心惊贴个自己的Blog http://blog.breakwire.me/blog/20150208/ 绝对跑得起来,跑不起来楼主凑我!
|
28
tolerious 2015 年 3 月 2 日 via iPhone
把listen那个去掉,不是已经8000端口转发了么?
|
29
1130335361 2015 年 4 月 2 日
@lsdvincent 1.logs下面的access.log和error.log是文件还是文件夹?2.需要自己建立吗
|
30
lsdvincent 2015 年 4 月 3 日 via iPhone
@1130335361 是文件;logs 文件夹要自己建立
|
31
lsdvincent 2015 年 4 月 3 日 via iPhone
@lsdvincent 只要建那个logs文件夹就行
|