linux下nginx+python配置
七月 17th, 2010 Posted in Nginx | 阅读次数: 735 次
Author:gaojinbo
Time:2010-7-17
linux下nginx+python配置,以下文章只记录了重点部分
mod_wsgi下载
http://hg.mperillo.ath.cx/nginx/mod_wsgi/archive/tip.tar.gz
1.Nginx安装
./configure --add-module=/path/to/mod_wsgi/ \ --prefix=/usr/local/nginx make make install
2.mod_wsgi安装
cd mod_wsgi-0.0.6/
Python setup.py –prefix=/usr/local/nginx –conf-path=/usr/local/nginx/conf –sbin-path=/usr/local/nginx/sbin
3.修改Nginx.conf文件
#user nobody;
worker_processes 4;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
use epoll; #linux2.6+
worker_connections 2048;
}
env HOME;
env PythonPATH=/www/web/py;
env Python_EGG_CACHE=/tmp;
http {
include conf/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip off;
wsgi_Python_optimize 2;
wsgi_Python_executable /usr/bin/Python;
#wsgi_Python_home /usr;
#wsgi_enable_subinterpreters on;
server {
listen 80;
server_name localhost;
include conf/wsgi_vars;
#wsgi_middleware wsgiref.validate validator;
#wsgi_middleware paste.lint;
location / {
root /www/web/py;
}
location /do {
#client_body_buffer_size 50;
wsgi_pass /www/web/py/nginx.py;
wsgi_pass_authorization off;
wsgi_script_reloading on;
wsgi_use_main_interpreter on;
}
}
}
done!
相关日志:
Tags: python
七月 18th, 2010 at 12:43
博主的主题很不错呀
七月 18th, 2010 at 22:14
。。。 说实话 天天看你的站 感觉 你天天都在电脑上折腾。。
可怜的ubuntu 感觉还是debian更合适你一些…
顺便说一句 我的网站回来了 osmsg.com 过来看看
七月 19th, 2010 at 12:24
兄弟,把我的链接改一下啊,http://www.ningyi.org,谢谢。呵呵
七月 20th, 2010 at 21:29
宁怡 好的,链接已成功修改:)
七月 20th, 2010 at 21:30
nsdy 你的站东西很好,技术文章少了点
八月 8th, 2010 at 11:26
你好博主,这个配置是在哪个版本的nginx下成功的呢?我用近期的版本都无法编译成功,能configure,但编译nginx时出错,是mod_wsgi的src里面一个文件出错
八月 9th, 2010 at 09:38
能configure,但编译nginx时出错
得把你的错误提示贴出来,才知道是哪里出了问题,这个问题相信你能搞定
十月 9th, 2010 at 15:07
“/path/to/mod_wsgi/” 如何理解啊?
十月 9th, 2010 at 16:17
/path/to/mod_wsgi/ 模块路径
五月 9th, 2011 at 21:34
Recommended Sites…
[...]below you’ll see my recommended links page http://www.yeastinfectiontreatmentcure.net/links/ with some excellent websites that I think you should definitely visit[...]…
七月 10th, 2011 at 22:14
Websites you should visit…
[...]below you’ll find the link to some sites that we think you should visit[...]……
七月 19th, 2011 at 15:40
Recent Blogroll Additions……
[...]usually posts some very interesting stuff like this. If you’re new to this site[...]……
八月 18th, 2011 at 11:58
You should check this out……
[...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]………
八月 24th, 2011 at 23:40
WOW! check this out!……
Amazing Post, worth a read……
九月 11th, 2011 at 18:27
Gems form the internet…
[...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……
九月 12th, 2011 at 04:50
Online Article……
[...]The information mentioned in the article are some of the best available [...]……