Django on Nginx
2009-05-13 12:05:44来源:未知 阅读 ()
[url=javascript:;]内存[/url]
,配置简单.
1.安装pythoncd /usr/ports/lang/python
[url=javascript:;]make[/url]
install clean
2.安装flup
cd /usr/ports/www/py-flup
make install clean
3.安装
[url=javascript:;]django[/url]
1)
cd /usr/ports/www/py-django
make install clean
4.安装
[url=javascript:;]nginx[/url]
cd /usr/ports/www/nginx
make install clean
5.启动和管理flup的脚本 参考
http://www.djangoproject.com/documentation/fastcgi/
#!/bin/sh
# Replace these three settings.
PROJDIR="/home/user/myproject"
PIDFILE="$PROJDIR/mysite.pid"
SOCKET="$PROJDIR/mysite.sock"
cd $PROJDIR
if [ -f $PIDFILE ]; then
kill `cat -- $PIDFILE`
rm -f -- $PIDFILE
fi
exec /usr/local/bin/python manage.py runfcgi method=prefork socket=${SOCKET} pidfile=${PIDFILE} minspare=5 maxspare=10 maxchildren=40
6.配置nginx 参考
http://wiki.codemongers.com/Main
nginx.conf
user www www;
worker_processes 5;
pid /var/run/nginx.pid;
error_log /var/log/httpd/error.log warn;
events {
worker_connections 10240;
use kqueue;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
connection_pool_size 256;
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
output_buffers 4 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
keepalive_timeout 75 20;
tcp_nodelay on;
client_max_body_size 10m;
client_body_buffer_size 256k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
client_body_temp_path /var/log/nginx/client_body_temp;
proxy_temp_path /var/log/nginx/proxy_temp;
fastcgi_temp_path /var/log/nginx/fastcgi_temp;
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- 分析squid的日志,罗列出一天最多的点击url 2009-05-13
- FreeBSD7 boot ZFS存储的规划 2009-05-13
- /boot不要单独分区! 2009-05-13
- Freebsd makeinfo: not found Error and Solution 2009-05-13
- Mount /usr/ports Inside Jail 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash