我用django+nginx+uwsgi部署django项目的时候,发现uwsgi一直启动不起来

我启动的时候没有报错,但是只有一个


root@localhost:/home/sscc/sscc2019# uwsgi --ini uwsgi.ini
[uWSGI] getting INI configuration from uwsgi.ini
root@localhost:/home/sscc/sscc2019# ps aux|grep uwsgi
root     11018  0.0  0.0  14224  1032 pts/0    S+   09:03   0:00 grep --color=auto uwsgi

这个是我的nginx启动情况


root@localhost:/home/sscc/sscc2019# ps aux|grep nginx
root     10997  0.0  0.0 125120  1456 ?        Ss   08:55   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 10998  0.0  0.0 125444  3188 ?        S    08:55   0:00 nginx: worker process
www-data 10999  0.0  0.0 125444  3188 ?        S    08:55   0:00 nginx: worker process
root     11024  0.0  0.0  14224   932 pts/0    S+   09:04   0:00 grep --color=auto nginx

然后我查看了uwsgi.log文件

*** Starting uWSGI 2.0.12-debian (64bit) on [Tue Mar 19 08:09:12 2019] ***
compiled with version: 5.4.0 20160609 on 28 September 2018 15:49:44
os: Linux-4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019
nodename: localhost
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/sscc/sscc2019
writing pidfile to uwsgi.pid
detected binary path: /usr/bin/uwsgi-core
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
chdir() to home/sscc/sscc2019
chdir(): No such file or directory [core/uwsgi.c line 2586]
*** Starting uWSGI 2.0.18 (64bit) on [Tue Mar 19 08:52:06 2019] ***
compiled with version: 5.4.0 20160609 on 15 March 2019 06:07:24
os: Linux-4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019
nodename: localhost
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /home/sscc/sscc2019
writing pidfile to /home/sscc/sscc2019/uwsgi.pid
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
setgid() to 2000
setuid() to 1000
chdir() to home/sscc/sscc2019
chdir(): No such file or directory [core/uwsgi.c line 2623]

我的uwsgi.ini在/home/sscc/sscc2019/uwsgi.ini

[uwsgi]
#socket=外网ip:端口(使用nginx连接时,使用socket)
#socket=我的外网IP:8000
socket=127.0.0.1:8000
chdir=home/sscc/sscc2019
wsgi-file=sscc2019/wsgi.py
processes=4
threads=2
master=True
pidfile=/home/sscc/sscc2019/uwsgi.pid
daemonize=/home/sscc/sscc2019/uswgi.log
module=sscc2019.wsgi:application
vacuum=true
chmod-socket=666
virtualenv=/root/.virtualenvs/ssccenv
harakiri=60
max-requests=5000
uid=1000
gid=2000
#plugin=python3

/etc/nginx/site-available/sscc2019.conf

root@localhost:/etc/nginx/sites-available# ls
default  sscc2019.conf
server{
    listen  80;
    charset utf-8;
    server_name 我的外网IP;
    
    client_max_body_size 75M;
        location / {
                include /home/sscc/sscc2019/uwsgi_params;
                uwsgi_pass 127.0.0.1:8000;
        }
        location /static {
                alias /var/www/sscc2019/static;
        }
    location /media {
        alias /home/sscc/sscc2019/media;
    }
}

请问这是什么原因呢

阅读 4.3k
1 个回答
chdir() to home/sscc/sscc2019
chdir(): No such file or directory [core/uwsgi.c line 2623]

很显然,你的路径最前面掉了个/

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题