RadarURL
Skip to content
2013.06.10 22:55

Nginx 설치 (간략)

조회 수 1694 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

Nginx 는 러시아에서 만든 웹서버로 접속이 많을 경우에도 안정적인 처리량을 보여주기때문에 사용자가 늘어나고 있는 추세이다. 다만 Nginx 에서 동적페이지인 PHP를 구동할 경우 오히려 Apache보다 처리능력이 떨어지기 때문에 이미지 웹서버만 분리해서 운영하려고 할때 좋은 성능을 보여준다.

가벼운 nginx를 전면에 두고 PHP처리가 필요한 호출에 대해서는 백단의 Apache에서 처리하도록 할 것이다.
Nginx 는 80포트, Apache는 8080으로 설정

Apache, PHP, MySql 등은 YUM을 통해 설치된 상태임. Apache포트는 8080으로 변경(가상호스트도 마찬가지)

1. Nginx 최신버젼 다운로드
wget http://nginx.org/download/nginx-1.1.0.tar.gz

2. configure 및 설치
./configure --prefix=/usr/local/nginx && make && make install
다른 옵션도 많으니 ./configure --help 로 확인해볼 것. 

3. 환경설정
/usr/local/nginx/conf/nginx.conf 에보면 예제로 PHP확장자의 처리에 대한 부분이 있다.
주석처리된 부분을 아래와 같이 수정한다.

location ~ \.php$ {
    proxy_pass   http://127.0.0.1:8080;
}
여러 확장자를 처리하고 싶으면  ~ \.(php|htm|html)$ 과 같이 쓰면 됨

4. 실행
/usr/local/nginx/sbin/nginx 를 실행하면 웹서버가 시작함

5. 종료
별도의 스크립트나 옵션을 제공하지 않으므로 kill을 이용해야 한다.
nginx.conf 에서 pid 경로 설정을 수정하지 않았으면 nginx.pid 파일이 /usr/local/nginx/logs/nginx.pid 에 생성되므로
kill -HUP `cat /usr/local/nginx/logs/nginx.pid` 명령으로 종료시킴
다만 현재 Centos 6에 설치했는데 -HUP 옵션을 붙이면 종료가 안되서 그냥
kill `cat /usr/local/nginx/logs/nginx.pid` 로 종료시키고 있음


참고 : http://wiki.nginx.org/

 

출처 : http://wyseburn.tistory.com/191

TAG •
?

  1. NGXMP 16.0 버전에서 Log에 upstream timed out (10060: 연결된 구성원으로부터 응답이 없어 연결하지 못했거나, 호스트로부터 응답이 없어 연결이 끊어졌습니다) while connecting to upstream, upstream: "fastcgi://127.0.0.1:9000"

    Date2014.04.11 ByJaeSoo Views2010
    Read More
  2. 504 Gateway Time-out using Nginx

    Date2014.04.09 ByJaeSoo Views1729
    Read More
  3. Nginx, FastCGI 지시어 및 설명 (504 Gateway Time-out 관련 설정 등)

    Date2014.04.09 ByJaeSoo Views2220
    Read More
  4. Nginx Log에서 upstream timed out (110: Connection timed out) while reading response header from upstream

    Date2014.04.08 ByJaeSoo Views1497
    Read More
  5. nginx 504 gateway time-out

    Date2014.04.08 ByJaeSoo Views1540
    Read More
  6. Nginx SERverSETting

    Date2014.04.07 ByJaeSoo Views1610
    Read More
  7. Nginx에서 php 외에 추가로 여러 확장자를 처리 방법

    Date2013.06.10 ByJAESOO Views2902
    Read More
  8. Nginx 설치 (간략)

    Date2013.06.10 ByJAESOO Views1694
    Read More
  9. Apache vs Nginx 성능을 밝혀라!

    Date2013.05.28 ByJAESOO Views3637
    Read More
  10. 아파치 2.4는 러시안 강호 NGINX를 넘을 수 있는가?

    Date2013.05.28 ByJAESOO Views2792
    Read More
  11. nginx 재시작 배치파일

    Date2013.04.12 ByJaeSoo Views3211
    Read More
  12. NGINX서버를 통한 다운로드 링크 형성하기(POGOPLUG SERIES 4용)

    Date2013.04.08 ByJaeSoo Views5302
    Read More
  13. nginx 에서 htaccess 사용하기

    Date2013.04.08 ByJaeSoo Views2874
    Read More
  14. Nginx HttpRewriteModule

    Date2013.04.08 ByJaeSoo Views2794
    Read More
  15. Nginx 와 Apache 동시사용 설정 (영문)

    Date2013.04.08 ByJaeSoo Views8866
    Read More
  16. Xpress engine nginx rewrite 설정, 짧은주소 (xpressengine)

    Date2012.11.20 ByJaeSoo Views65785
    Read More
  17. NGINX 소개와 사용 현황

    Date2012.11.20 ByJaeSoo Views4819
    Read More
  18. 강력한 웹서버 NGINX

    Date2012.11.20 ByJaeSoo Views5069
    Read More
  19. Nginx 웹서버 성능분석

    Date2012.11.20 ByJaeSoo Views5734
    Read More
  20. 제로보드XE(Xpressengine) Anti-accessXE:기본설정

    Date2012.07.26 ByJaeSoo Views3922
    Read More
Board Pagination Prev 1 2 Next
/ 2

PageViews   Today : 173 Yesterday : 2394 Total : 21713831  /  Counter Status   Today : 151 Yesterday : 1232 Total : 1142293

Edited by JAESOO

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소