我准备将nginx/uwsgi与烧瓶用于我正在开发的网站,但我遇到了问题。注意网站本身运行良好使用烧瓶的调试:5000端口,但我想现在投入生产。解释我做了什么。只能以root身份运行uwsgi

这是一个的Linode的Ubuntu 12.04LTS服务器,我安装了它这样的:

# install nginx

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:nginx/stable

sudo apt-get update

sudo apt-get upgrade --show-upgraded

sudo apt-get install nginx-full

# installing uwsgi

sudo apt-get install build-essential python-dev libxml2-dev

sudo apt-get install libc6 libexpat1 libgd2-xpm libgeoip1 libpam0g libpcre3 libssl1.0.0 libxml2 libxslt1.1 zlib1g

sudo pip install uwsgi

# python basics

sudo apt-get install python-pip build-essential python-dev

sudo pip install virtualenv

sudo pip install virtualenvwrapper

sudo mkdir -p /srv/www/li/

cd /srv/www/li/

virtualenv venv

source /srv/www/li/venv/bin/activate

pip install flask

然后我开始配置一切,但我已经运行到与uwsgi麻烦(没关系NGINX,这将是。下一步

sudo nano /etc/uwsgi/apps-available/li.xml

python

/run/uwsgi/app/li.socket

666

/srv/www/li

/srv/www/li

/srv/www/li/venv

li

/srv/www/li/li.py

app

4

60

8

1

/tmp/stats.socket

2000

512

256

192

sudo ln -s /etc/uwsgi/apps-available/li.xml /etc/uwsgi/apps-enabled/li.xml

但是,如果我运行它,我得到:

uwsgi --xml /etc/uwsgi/apps-enabled/li.xml

[uWSGI] parsing config file /etc/uwsgi/apps-enabled/li.xml

open("./python_plugin.so"): No such file or directory [core/utils.c line 4755]

!!! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!!

*** Starting uWSGI 1.4.6 (64bit) on [Thu Feb 28 16:30:53 2013] ***

compiled with version: 4.6.3 on 28 February 2013 12:38:22

os: Linux-3.7.10-x86_64-linode30 #1 SMP Wed Feb 27 14:29:31 EST 2013

nodename: demo

machine: x86_64

clock source: unix

detected number of CPU cores: 4

current working directory: /run/uwsgi/app

detected binary path: /usr/local/bin/uwsgi

your processes number limit is 63594

limiting address space of processes...

your process address space limit is 536870912 bytes (512 MB)

your memory page size is 4096 bytes

*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***

detected max file descriptor number: 1024

lock engine: pthread robust mutexes

uwsgi socket 0 bound to UNIX address /run/uwsgi/app/li.socket fd 3

Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3]

Set PythonHome to /srv/www/li/venv

*** Python threads support is disabled. You can enable it with --enable-threads ***

Python main interpreter initialized at 0xa86e20

your server socket listen backlog is limited to 100 connections

mapped 362120 bytes (353 KB) for 4 cores

*** Operational MODE: preforking ***

added /srv/www/li/ to pythonpath.

/srv/www/li/venv/local/lib/python2.7/site-packages/mongoengine/fields.py:744: FutureWarning: ReferenceFields will default to using ObjectId strings in 0.8, set DBRef=True if this isn't desired

warnings.warn(msg, FutureWarning)

WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0xa86e20 pid: 14934 (default app)

*** uWSGI is running in multiple interpreter mode ***

spawned uWSGI master process (pid: 14934)

spawned uWSGI worker 1 (pid: 14940, cores: 1)

mapping worker 1 to CPUs: 0

spawned uWSGI worker 2 (pid: 14941, cores: 1)

mapping worker 2 to CPUs: 1

spawned uWSGI worker 3 (pid: 14942, cores: 1)

mapping worker 3 to CPUs: 2

spawned uWSGI worker 4 (pid: 14943, cores: 1)

unlink(): Operation not permitted [core/socket.c line 109]

bind(): Address already in use [core/socket.c line 141]

...brutally killing workers...

mapping worker 4 to CPUs: 3

VACUUM: unix socket /run/uwsgi/app/li.socket removed.

,所以我得到不允许取消链接操作,并且绑定地址已经在使用错误(在python_plugin错误旁边,我也没有线索如何解决这个错误!)。如果我作为sudo运行,它似乎工作正常 - >

sudo uwsgi --xml /etc/uwsgi/apps-enabled/li.xml

[uWSGI] parsing config file /etc/uwsgi/apps-enabled/li.xml

open("./python_plugin.so"): No such file or directory [core/utils.c line 4755]

!!! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!!

*** Starting uWSGI 1.4.6 (64bit) on [Thu Feb 28 15:47:41 2013] ***

compiled with version: 4.6.3 on 28 February 2013 12:38:22

os: Linux-3.7.10-x86_64-linode30 #1 SMP Wed Feb 27 14:29:31 EST 2013

nodename: demo

machine: x86_64

clock source: unix

detected number of CPU cores: 4

current working directory: /run/uwsgi

detected binary path: /usr/local/bin/uwsgi

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

your processes number limit is 63594

limiting address space of processes...

your process address space limit is 536870912 bytes (512 MB)

your memory page size is 4096 bytes

*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***

detected max file descriptor number: 1024

lock engine: pthread robust mutexes

uwsgi socket 0 bound to UNIX address /run/uwsgi/app/li.socket fd 3

Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3]

Set PythonHome to /srv/www/li/venv

*** Python threads support is disabled. You can enable it with --enable-threads ***

Python main interpreter initialized at 0x1fc9d00

your server socket listen backlog is limited to 100 connections

mapped 362120 bytes (353 KB) for 4 cores

*** Operational MODE: preforking ***

added /srv/www/li/ to pythonpath.

/srv/www/li/venv/local/lib/python2.7/site-packages/mongoengine/fields.py:744: FutureWarning: ReferenceFields will default to using ObjectId strings in 0.8, set DBRef=True if this isn't desired

warnings.warn(msg, FutureWarning)

WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1fc9d00 pid: 14755 (default app)

*** uWSGI is running in multiple interpreter mode ***

spawned uWSGI master process (pid: 14755)

spawned uWSGI worker 1 (pid: 14761, cores: 1)

mapping worker 1 to CPUs: 0

spawned uWSGI worker 2 (pid: 14762, cores: 1)

mapping worker 2 to CPUs: 1

spawned uWSGI worker 3 (pid: 14763, cores: 1)

mapping worker 3 to CPUs: 2

spawned uWSGI worker 4 (pid: 14764, cores: 1)

*** Stats server enabled on /tmp/stats.socket fd: 16 ***

mapping worker 4 to CPUs: 3

任何人都可以请帮助我吗?由于WWW的数据是www数据组中,他跑了,我尝试了一些东西:

sudo usermod -a -G www-data $USER

sudo chown -R $USER:www-data /srv/www/li

sudo chmod -R g+r+w+x /srv/www/li

sudo chown -R $USER:www-data /etc/uwsgi/apps-enabled

sudo chmod -R g+r+w+x /etc/uwsgi/apps-enabled

sudo chown -R $USER:www-data /run/uwsgi/app

sudo chmod -R g+r+w+x /run/uwsgi/app

但真的没有帮助。我也尝试了一个tcp端口,而不是unix/run/uwsgi/app/port,这两个端口没有任何区别... 这让我很疯狂:(我希望有人对这里发生的事情有一点线索

亲切的问候,

岩溶

编辑:

[email protected]:~$ uwsgi --xml /etc/uwsgi/apps-enabled/li.xml

[uWSGI] parsing config file /etc/uwsgi/apps-enabled/li.xml

*** Starting uWSGI 1.4.6 (64bit) on [Thu Feb 28 18:47:36 2013] ***

compiled with version: 4.6.3 on 28 February 2013 12:38:22

os: Linux-3.7.10-x86_64-linode30 #1 SMP Wed Feb 27 14:29:31 EST 2013

nodename: demo

machine: x86_64

clock source: unix

detected number of CPU cores: 4

current working directory: /home/geoadmin

detected binary path: /usr/local/bin/uwsgi

your processes number limit is 63594

limiting address space of processes...

your process address space limit is 536870912 bytes (512 MB)

your memory page size is 4096 bytes

*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***

detected max file descriptor number: 1024

lock engine: pthread robust mutexes

bind(): No such file or directory [core/socket.c line 141]

2013-02-28

Carst

linux uwsgi 非root,只能以root身份运行uwsgi相关推荐

  1. 解决IE只能用管理员身份运行才能正常

    不知道大家有没有遇到这种情况,在毫不知情的情况下 IE10 突然打不开了,必须要用管理员身份运行才可以打开,而且重置浏览器这个方法也不奏效- 今天清枫也遇到了,上网查找发现是注册表权限的问题,  原因 ...

  2. linux uwsgi 非root,nginx – 只能用root运行uwsgi

    我正在准备使用nginx / uwsgi与烧瓶我正在开发的网站,但我遇到问题.注意,网站本身运行良好使用烧瓶的调试:5000端口,但我现在想投入生产.解释我做了什么 它是一个linode ubuntu ...

  3. linux uwsgi 非root,nginx – 只能用root运行uwsgi

    我正在准备使用Nginx / uwsgi与烧瓶我正在开发的网站,但我遇到问题.注意,网站本身运行良好使用烧瓶的调试:5000端口,但我现在想投入生产.解释我做了什么 它是一个linode ubuntu ...

  4. kali 改root_Kali Linux 将默认以非 root 身份运行

    Kali Linux团队宣布,从即将推出的2020.1版本开始,Kali Linux发行版将默认用户为非root用户,从而切换到新的安全模型.2020.1版本计划于2020年1月下旬发布,用户现在可以 ...

  5. linux uwsgi 非root,ubuntu-除非root用户,否则uWSGI Emperor权限被拒绝

    我试过使用二进制文件本身的标志(–uid www-data –gid www-data)并将其设置在我的配置中: uid = www-data gid = www-data 但是套接字始终是使用我正在 ...

  6. linux以非root身份运行,以非root用户身份在linux中运行mono-service

    我需要在嵌入式系统上以最低Ubuntu安装方式运行.net C#应用程序(在Windows系统上开发)作为服务/守护程序(不包括X,除服务器外SSH,只有相关的软件).我创建了一个/etc/init. ...

  7. linux默认开启sudo_Sudo漏洞允许非特权Linux和macOS用户以root身份运行命令

    原标题:Sudo漏洞允许非特权Linux和macOS用户以root身份运行命令 苹果安全团队成员Joe Vennix发现了sudo实用程序中的一个重要漏洞,即在特定配置下,它可能允许低特权用户或恶意程 ...

  8. linux uwsgi 非root,ubuntu-除非root用户,否则uWSGI Emperor权限被拒...

    我试过使用二进制文件本身的标志(–uid www-data –gid www-data)并将其设置在我的配置中: uid = www-data gid = www-data 但是套接字始终是使用我正在 ...

  9. linux uwsgi 非root,linux 安装uwsgi

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? linux 安装uwsgi 安装并查看版本 • yum groupinstall "Development t ...

  10. linux用户的vim命令无效,Linux SUDO Bug可让您以root用户身份运行命令,大多数命令不受影响...

    已发现Linux sudo命令中的漏洞,该漏洞可能允许非特权用户以root用户身份执行命令.幸运的是,此漏洞仅在非标准配置中有效,并且大多数Linux服务器不受影响. 在获得此漏洞之前,重要的是要掌握 ...

最新文章

  1. Hibernate和Mysql5.1以上版本创建表出错 type=InnDB
  2. Git 的工作区、暂存区、版本库—— Git 学习笔记 15
  3. JAVA之获取JavaSwing复选框JCheckBox选中的值(内容)
  4. postgresql(2)
  5. Spring boot web开发实战
  6. NYOJ241 - 字母统计
  7. C语言—预定义宏调试__LINE__、__func__
  8. go -生成pb文件 - 上
  9. 字典 python 引用_Python字典引用的应用
  10. HTML简单登录界面的实现
  11. 深入浅出、通俗易懂的讲解CAN bus
  12. MISRA C编程规范标准
  13. 079冒险岛mysql解封账号_Win7系统玩冒险岛079单机版输入账号密码后出现error38如何解决?...
  14. 用ps换证件照照片底色
  15. 两台计算机远程桌面连接不上去,远程桌面连接不上怎么办
  16. CSS 文字样式 第二节
  17. web前端开发分享-css,js进阶篇
  18. dmp标签_用户标签/用户分群在DMP(数据管理平台)中的应用
  19. maximo附件WebSphere环境下配置
  20. 1060驱动java_ubuntu16.04 安装 GTX 1060 显卡驱动

热门文章

  1. TLF 使用详解!!
  2. PCL教程-点云配准之正态分布变换算法(NDT)
  3. 老中医化妆品效果怎么样?舒缓系列拒绝敏感肌肤困扰
  4. win7设置文件夹共享 win7共享文件夹
  5. Tornado @tornado.gen.coroutine 与 yield
  6. 【FinalIK】Full Body Biped IK
  7. JeecgBoot集成DataV组件库
  8. SitePoint播客#67:浏览器之舞
  9. AMiner推荐论文:Flexible artificial Si-In-Zn-O/ion gel synapse and its application to sensory-neuromorphi
  10. linux_study_1