勤勉敦敏 2022-01-21 18:04 采纳率: 82.8%
浏览 19
已结题

django项目在 ubuntu里设置uwsgi.ini无法启动

问题遇到的现象和发生背景

用uwsgi --http :8000 --chdir /home/cc/web1(项目地址) --module web1.wsgi 可以正常启动
换成uwsgi ini uwsgi.ini
显示[uWSGI] getting INI configuration from uwsgi.ini
但是lsof查看没有uwsgi进程
查看log日志最后一行报错
还有个问题,如果指定http=192.168.1.1:8000 日志文件里仍然显示地址是0.0.0.0:8000

问题相关代码,请勿粘贴截图

这是uwsgi配置文件
[uwsgi]

项目目录

chdir=/home/cc/web1/

指定项目的application

module=web1.wsgi:application

指定sock的文件路径

socket=/home/cc/web1/script/uwsgi.sock

进程个数

workers=5

pidfile=/home/cc/web1/script/uwsgi.pid

指定IP端口

http=0.0.0.0:8000
#如果指定http=192.168.1.1:8000 日志文件里仍然显示地址是0.0.0.0:8000 《-请看这里

指定静态文件

#static-map=/static=/home/cc/web1/static/

启动uwsgi的用户名和用户组

uid=www-data

gid=www-data

启用主进程

master=true

自动移除unix Socket和pid文件当服务停止的时候

vacuum=true

序列化接受的内容,如果可能的话

thunder-lock=true

启用线程

enable-threads=true

设置自中断时间

harakiri=30

设置缓冲

运行结果及报错内容

[](


```python
*** Starting uWSGI 2.0.20 (64bit) on [Fri Jan 21 15:55:24 2022] ***
compiled with version: 9.3.0 on 21 January 2022 03:18:57
os: Linux-5.13.0-27-generic #29~20.04.1-Ubuntu SMP Fri Jan 14 00:32:30 UTC 2022
nodename: ubuntu
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /home/cc/web1
writing pidfile to /home/cc/web1/script/uwsgi.pid
detected binary path: /home/cc/.local/bin/uwsgi
chdir() to /home/cc/web1/
your processes number limit is 7519
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: enabled
uWSGI http bound on 0.0.0.0:8000 fd 3
**chown(): Operation not permitted [core/utils.c line 2657]**     《=========================请看这里
*** Starting uWSGI 2.0.20 (64bit) on [Fri Jan 21 15:55:39 2022] ***
compiled with version: 9.3.0 on 21 January 2022 03:18:57

```)

我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 系统已结题 7月25日
  • 已采纳回答 7月17日
  • 修改了问题 1月21日
  • 创建了问题 1月21日

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分