Skip to content

Python 으로 가장 많이 이용되는 웹프레임워크는 Django 이다. 최근 가벼움과 성능으로 인정을 받고 있는 NginX 와 FastCGI 로 연동하여 설치하는 방법을 간단하게 정리해보았다. CentOS 6.0 이 나오긴 했지만, 아직 5.x 환경도 많이 이용되고 있으리라 생각하여 CentOS 5.6 에서 테스트하였으며, 아마 6.0 에서도 무리없이 설치될 것으로 믿는다.

  1. Install Python
    # echo 'export PYTHONBREW_ROOT=/opt/pythonbrew' >> /etc/profile; source /etc/profile
    # curl -kLO http://xrl.us/pythonbrewinstall; chmod +x pythonbrewinstall; ./pythonbrewinstall
    # echo 'source /opt/pythonbrew/etc/bashrc' >> /etc/profile; source /etc/profile
    # pythonbrew install --force --no-test 2.7.2
    # pythonbrew switch 2.7.2
  2. Install Django
    # pip install django flup
  3. Create Project
    # mkdir -p /opt/project
    # cd /opt/project
    # django-admin.py startproject sample_project
    # cd sample_project
    # mkdir media
  4. Run Project
    # cd /opt/project/sample_project
    # python manage.py runfcgi method=prefork pidfile=/tmp/django_sample.pid host=127.0.0.1 port=8000
  5. Install NginX
    # yum install nginx
  6. Configure NginX
    # cd /etc/nginx
    # vi nginx.conf
    ...
        server {
            server_name 도메인주소;
            location /site_media  {
                root /opt/project/sample_project/media/;
            }
            location / {
                # host and port to fastcgi server
                fastcgi_pass 127.0.0.1:8000;
                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_pass_header Authorization;
                fastcgi_intercept_errors off;
            }
        }
    ...
  7. Run NginX
    # /etc/init.d/nginx restart
profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/278629/5d5/trackback
List of Articles
번호 제목 글쓴이 날짜sort 조회 수

/var 디렉토리 용량이 갑자기!!!

마우스 오른쪽 버튼 막기...

OS 종류 및 버전확인

콘솔에서 로그인이 안될때

top 명령어 정리

파일시스템 체크

외국 자료실 (Unix Linux Windows)

netstat 의 Send-Q, Recv-Q의 의미

특정 디랙토리 인증걸기 htpasswd, htaccess

리눅스 TIP

Cent5 ffmpeg 설치

rm -rf / ==> 그 결과는...ㄷㄷ;;

dumpe2fs 파일 시스템의 슈퍼 블럭과 블럭 그룹 정보를 출력

사이트 이전시 - rsync

.vimrc 설정 설정, 색상 (VI 설정 색상)

리눅스 페도라 인터넷잡는것좀 알켜주세요^^; [1]

  • 시풍
  • 2009-04-07
  • 조회 수 20670

time.bora.net 시간 동기화후 dovecot 데몬이 죽는 현상 해결

관리, 개발자를 위한 vi 환경 설정 ( vim-enhanced)

ssh, ftp 접근 딜레이 현상 발생시 조치방법

리눅스 java tocmat 설치

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234