根据uwsgi的官方文档。我安装了uwsgi,结果是uwsgi这个工具安装好了。但是python里的模块没有。当我import uwsgi时报错说没有这个模块。我不知道这是什么问题。我的安装方法如下: easy_install-2.6 uwsgi
但是结果说没有这个模块:
[root@host93-16 uwsgi-0.9.9.2]# python
Python 2.6 (r26:66714, Dec 15 2010, 17:34:26)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import uwsgi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named uwsgi
奇怪的是我的uwsgi 这个命令是安装好的。安装过程中也没有任何报错.
后来我根据官方文档里的quickstart()写了个测试的代码: pys.py
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
然后用 uwsgi -p 8 --gid www --uid www -s 127.0.0.1:8015 --wsgi-file /tmp/pys.py 起来进程
但是nginx还是不能访问。
nginx 配置很简单:
location / {
uwsgi_pass 127.0.0.1:8015;
include uwsgi_params;
}
有人指点下。到底要怎么弄么。网上文章都是写和django结合的。我不想用框架。想自己写脚本实现。谢谢
但是结果说没有这个模块:
[root@host93-16 uwsgi-0.9.9.2]# python
Python 2.6 (r26:66714, Dec 15 2010, 17:34:26)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import uwsgi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named uwsgi
奇怪的是我的uwsgi 这个命令是安装好的。安装过程中也没有任何报错.
后来我根据官方文档里的quickstart()写了个测试的代码: pys.py
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
然后用 uwsgi -p 8 --gid www --uid www -s 127.0.0.1:8015 --wsgi-file /tmp/pys.py 起来进程
但是nginx还是不能访问。
nginx 配置很简单:
location / {
uwsgi_pass 127.0.0.1:8015;
include uwsgi_params;
}
有人指点下。到底要怎么弄么。网上文章都是写和django结合的。我不想用框架。想自己写脚本实现。谢谢
