[Setting] Nginx + Tornaldo + Django + python 2.7.2

까먹을까봐 기록해두자.

1] python

apt-get install zlib1g-dev

apt-get install libbz2-dev

apt-get install libssl-dev

wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

tar jxvf  Python-2.7.2.tar.bz2

./configure

make; make install

ln -sf /usr/local/bin/python2.7 /usr/bin/python

2] setuptools, pip

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e

tar zxvf  setuptools-0.6c11.tar.gz

python setup.py build

python setup.py install

ezsy_install pip (이후론 전부 pip)

3]virtualenv

pip install virtualenv

virtualenv –no-site-packages project1

./project1/bin/activate

pip install pycurl

pip install simplejson

pip freeze > pip-req.txt

4]  django

pip install django

5] tornaldo

pip install http://github.com/downloads/facebook/tornado/tornado-2.1.1.tar.gz

6]nginx

sudo apt-get install libpcre3 libpcre3-dev

wget http://nginx.org/download/nginx-1.0.11.tar.gz

tar zxvf nginx-1.0.11.tar.gz

./configure

make; make install

[nginx.conf]
worker_processes 1;

events {

worker_connections 1024;
use epoll;
}
http {
upstream tornadoserver {
server 127.0.0.1:8888;
}
include mime.types;
default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

#gzip on;
include /usr/local/nginx/conf.d/*.conf;

server {
listen 80;
server_name localhost;

location / {
proxy_pass http://127.0.0.1:8888;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root html;
}

}