分类: Python/Ruby
2012-11-01 16:40:00
一,django开发包的位置在/home/cccms/
二,搭建nginx平台
1)安装python的flup插件
yum install python2.6 python-setuptools
easy_install flup或python set.py install
2)安装nginx
yum install openssl-devel
yum install pcre-devel
tar -zxvf nginx-1.3.1.tar.gz
cd nginx-1.3.1
./configure
make
make install
编辑nginx.conf,添加如下:
location / {
root /home/cccms/;
fastcgi_pass 127.0.0.1:8851;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_param REMOTE_ADDR $remote_addr;
}
三,运行django项目
在项目中运行
python manage.py runfcgi method=threaded host=127.0.0.1 port=8851
四,运行nginx
./nginx