linux uwsgi 非root,nginx – 只能用root运行uwsgi
我正在准备使用Nginx / uwsgi与烧瓶我正在开发的网站,但我遇到问题.注意,网站本身运行良好使用烧瓶的调试:5000端口,但我现在想投入生产.解释我做了什么
它是一个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
cpu-affinity>1cpu-affinity>
RSS>192RSS>
但是,如果我运行它,我得到:
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.
所以我得到unlink操作不允许和绑定地址已经在使用中的错误(旁边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,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,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,没有任何区别…
这让我疯狂:(我希望有人对这里发生的事情有一个线索.
亲切的问候,
CARST
编辑:服务器重新启动后仍然给出一个错误,但是不同的:
geoadmin@demo:~$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]
linux uwsgi 非root,nginx – 只能用root运行uwsgi相关推荐
- linux uwsgi 非root,nginx – 只能用root运行uwsgi
我正在准备使用nginx / uwsgi与烧瓶我正在开发的网站,但我遇到问题.注意,网站本身运行良好使用烧瓶的调试:5000端口,但我现在想投入生产.解释我做了什么 它是一个linode ubuntu ...
- linux uwsgi 非root,ubuntu-除非root用户,否则uWSGI Emperor权限被拒绝
我试过使用二进制文件本身的标志(–uid www-data –gid www-data)并将其设置在我的配置中: uid = www-data gid = www-data 但是套接字始终是使用我正在 ...
- linux uwsgi 非root,ubuntu-除非root用户,否则uWSGI Emperor权限被拒...
我试过使用二进制文件本身的标志(–uid www-data –gid www-data)并将其设置在我的配置中: uid = www-data gid = www-data 但是套接字始终是使用我正在 ...
- linux uwsgi 非root,linux 安装uwsgi
8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? linux 安装uwsgi 安装并查看版本 • yum groupinstall "Development t ...
- linux装软件需要root用户,Linux下非root用户安装软件的一般流程:
1. 获取源代码,一般是wget方式,ubuntu可以使用apt-get source来获取源代码. 2. 解压源代码,一般使用tar -zxvf xxx.tar.gz即可 3. 切换到解压后的目录, ...
- linux下非root用户如何修改root权限的文件
在linux下会出现把一些配置文件参数配错.root密码忘记等导致系统无法启动或进入root的窘迫境地,本文以redhat enterprise linux server 6.4为例介绍root身份 ...
- Linux查hudi服务的进程,Linux查看非root运行的进程
Linux查看非root运行的进程 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ps -U root -u root -N PID TTY TIME CMD ...
- linux是不是在根目录下安装的软件其它用户就可以使用,[转载]Linux下非root用户如何安装软件...
[转载]Linux下非root用户如何安装软件 这是本人遇到的实际问题,之前用到的所有机器,无论是自己的PC还是云服务器,root权限都是妥妥的,但是现在发现实验室的服务器原来自己并没有root权限2 ...
- linux nginx root目录,详解nginx.conf 中 root 目录设置问题
在配置 nginx.conf 总会遇到一些问题,下面列举一些常见的问题并说明如何解决 1.相对路径的问题 例如配置文件中 location 设置 location ~ .php${ root html ...
最新文章
- Java多线程复习:2(线程的创建和使用)
- OpenCV识别形状
- 中国首篇Science机器人子刊!北航软体机器人实验室四年成果登上封面长篇
- VMware 下扩展linux硬盘空间
- 处理微信文章中防盗链问题
- Spring Boot Serverless 实战系列“部署篇” | Mall 应用
- SQL语言学习(六)分组函数学习
- python基础技巧总结(三)
- ios 查看同文件名_实战恢复cisco 2950交换机的IOS
- c语言文件实现通信录程序,学C三个月了,学了文件,用C语言写了个通讯录程序...
- Linux下x86_64进程地址空间布局
- 反向链接referrer的原理
- python全局变量可以改变吗_在Python中避免我的全局变量,我有几个函数可以改变一个变量...
- 利用VS自带发布功能实现web项目快速部署
- MFC Windows 程序设计[十六]之小小计算器
- AXURE母版事件(Raised-events)
- 供配电系统自动化实训
- RFC2544吞吐量测试详细步骤-MiniSMB-HurricaneII软件操作演示
- Android实现异步加载图片 ListView
- NSD ADMIN DAY01