通过yum install uwsgi 安装的uwsgi在进行测试的时候,发现版本是2.0.15,但是启动uwsgi测试的时候报参数错误,后来改用pip安装(先yum remove uwsgi删除老的uwsgi)就成功了。uwsgi安装完成之后的样子
安装pip
wget https://bootstrap.pypa.io/get-pip.py python ./get-pip.py安装uwsgi,一个干净的linux系统安装uwsgi过程中,会遇到以下两个错误。
Exception: you need a C compiler to build uWsgi ---------------------------------------- Failed building wheel for uwsgi Running setup.py clean for uwsgi Failed to build uwsgi Installing collected packages: uwsgi Running setup.py install for uwsgi ... error解决办法:yum install gcc-*
另外一个错误:
Fatal error: Python.h: No such file or directory
解决办法:yum install python-devel
安装成功的打印信息:
[ [email protected]_68_155_centos ~]# pip install uwsgi Collecting uwsgi Using cached uwsgi-2.0.16.tar.gz Building wheels for collected packages: uwsgi Running setup.py bdist_wheel for uwsgi ... done Stored in directory: /root/.cache/pip/wheels/3a/e7/aa/24207bb9d885fe11fab3f7ad7d9d80c538a423d98494d43fd7 Successfully built uwsgi Installing collected packages: uwsgi Successfully installed uwsgi-2.0.16 [ [email protected]_68_155_centos ~]#编辑一个简单的测试文件hello.py:
def application(env,start_response): start_response( ‘200 OK‘,[(‘Content-Type‘,‘text/HTML‘)]) return "Hello,world"启动uwsgi : uwsgi --http-socket :80 --wsgi-file hello.py
[ [email protected]_68_155_centos ~]# /usr/bin/uwsgi --http-socket :80 --wsgi-file hello.py *** Starting uWsgi 2.0.16 (64bit) on [Fri Feb 23 15:31:16 2018] *** compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 23 February 2018 07:28:20 os: linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 nodename: VM_68_155_centos machine: x86_64 clock source: unix detected number of cpu cores: 1 current working directory: /root detected binary path: /usr/bin/uwsgi !!! no internal routing support,rebuild with pcre support !!! dropPing root privileges as early as possible uWsgi running as root,you can use --uID/--gID/--chroot options *** WARNING: you are running uWsgi as root !!! (use the --uID flag) *** *** WARNING: you are running uWsgi without its master process manager *** your processes number limit is 3895 your memory page size is 4096 bytes detected max file descriptor number: 100001 lock engine: pthread robust mutexes thunder lock: Disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address :80 fd 3 dropPing root privileges after socket binding uWsgi running as root,you can use --uID/--gID/--chroot options *** WARNING: you are running uWsgi as root !!! (use the --uID flag) *** Python version: 2.7.5 (default,Aug 4 2017,00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] *** Python threads support is Disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0x7d64c0 dropPing root privileges after plugin initialization uWsgi running as root,you can use --uID/--gID/--chroot options *** WARNING: you are running uWsgi as root !!! (use the --uID flag) *** your server socket Listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 72904 bytes (71 KB) for 1 cores *** Operational MODE: single process *** Wsgi app 0 (mountpoint=‘‘) ready in 0 seconds on interpreter 0x7d64c0 pID: 6557 (default app) dropPing root privileges after application loading uWsgi running as root,you can use --uID/--gID/--chroot options *** WARNING: you are running uWsgi as root !!! (use the --uID flag) *** *** uWsgi is running in multiple interpreter mode *** spawned uWsgi worker 1 (and the only) (pID: 6557,cores: 1)测试uwsgi-server
总结以上是内存溢出为你收集整理的linux下通过pip安装最新uwsgi 通不过测试的时候,要用socket不能直接http全部内容,希望文章能够帮你解决linux下通过pip安装最新uwsgi 通不过测试的时候,要用socket不能直接http所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)