10
Confidential [Megabox]Tomcat_설정보고서.docx Last printed on 4/2/2013 10:16:00 AM Nginx 1.2.7 설치 가이드 문서 Project Name: Nginx 설치 Department: 오픈소스 컨설팅 미들웨어 Focus Area: Web Server Product/Process: Nginx 1.2.7 Stable version Prepared By: Document Owner(s) Project/Organization Role Man-Woong Choi Technical Assistance Project Status Report Version Control Version Date Author Change Description 1.0 2013/03/27 Man-Woong Choi Document created [Version # ] [mm/dd/yy] [Change owner] [Change 1] [Change 2] [Change n]

[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Embed Size (px)

DESCRIPTION

This is a guide document for installation NginX on Linux platform

Citation preview

Page 1: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confidential

[Megabox]Tomcat_설정보고서.docx

Last printed on 4/2/2013 10:16:00 AM

Nginx 1.2.7 설치 가이드 문서

Project Name: Nginx 설치

Department: 오픈소스 컨설팅 미들웨어

Focus Area: Web Server

Product/Process: Nginx 1.2.7 Stable version

Prepared By:

Document Owner(s) Project/Organization Role

Man-Woong Choi Technical Assistance

Project Status Report Version Control

Version Date Author Change Description

1.0 2013/03/27 Man-Woong Choi Document created

[Version #] [mm/dd/yy] [Change owner]

[Change 1]

[Change 2]

[Change n]

Page 2: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 2 4/2/2013

TABLE OF CONTENTS

1 1. 본 문서의 목적 ...................................................................................................................... 3

1.1 작업 일시 .................................................................................................................... 3

1.2 작업의 범위 .................................................................................................................. 3

2 NGINX 설치 ........................................................................................................................... 4

2.1 설치 시스템 정보 ........................................................................................................... 4

2.2 설치 파일 다운로드 ........................................................................................................ 4

2.3 설치 전 필수 library pkg 설치 ......................................................................................... 5

2.4 Nginx Source Compile & Build .................................................................................. 5

2.5 Nginx의 시작 .............................................................................................................. 7

2.6 Nginx 작동 상태 점검하기............................................................................................... 8

2.7 Nginx의 정지 .............................................................................................................. 8

3 NGINX 설치 승인..................................................................................................................... 9

4 APPENDICES .................................................................................................................... 10

4.1 Document Guidelines ............................................................................................. 10

4.2 Project Migration Report Sections Omitted .............................................................. 10

1

Page 3: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 3 4/2/2013

1. 본 문서의 목적

본 문서의 목적은 현재 WebServer플랫폼으로 각광을 받고 있는 Nginx 관련 설치에 대한 내용을 정리한

문서 입니다.

본 문서에는 Nginx 설치에 대한 정보를 모두 포함하고 있습니다.

1.1 작업 일시

구분 내용

시간 2013년 4월 1일 오전 10시~12시

장소 오픈소스 컨설팅 본사

작업자 최만웅 차장([email protected])

담당 매니저 최지웅 이사([email protected])

1.2 작업의 범위

작업에 대한 결과 리포트는 아래와 같은 내용을 포함하고 있습니다.

Nginx 1.2.7 Stable version Install

Page 4: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 4 4/2/2013

2 Nginx 설치

2.1 설치 시스템 정보

설치 시스템 정보는 다음과 같습니다.

RHEL 6.4

[mwchoi-vm01:/]# uname -a

Linux mwchoi-vm01 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64

x86_64 x86_64 GNU/Linux

[mwchoi-vm01:/]#

2.2 설치 파일 다운로드

다음의 URL 에서 설치를 할 Stable Version 을 다운 로드 받습니다.

http://nginx.org/en/download.html

Page 5: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 5 4/2/2013

2.3 설치 전 필수 library pkg 설치

Nginx 를 설치하기 위해서 기본적으로 설치되어 하는 OS 패키지는 다음과 같습니다.

A. gcc

B. pcre-devel

C. zlib-devel

D. openssl-devel

[mwchoi-vm01:/data/nginx]# yum install gcc zlib-devel openssl-devel pcre-devel

Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-

packagekit, security,

: subscription-manager, tmprepo, verify, versionlock

This system is not registered to Red Hat Subscription Management. You can use

subscription-manager to register.

Loading support for Red Hat kernel ABI

Setting up Install Process

Package gcc-4.4.7-3.el6.x86_64 already installed and latest version

Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version

Package openssl-devel-1.0.0-27.el6.x86_64 already installed and latest version

Package pcre-devel-7.8-6.el6.x86_64 already installed and latest version

Nothing to do

[mwchoi-vm01:/data/nginx]#

2.4 Nginx Source Compile & Build

다운받은 Nginx 의 stable version 을 압축해제 합니다.

[mwchoi-vm01:/data/nginx]# tar -xvzf nginx-1.2.7.tar.gz

[mwchoi-vm01:/data/nginx]# ls -l

total 4

drwxr-xr-x. 8 1001 1001 4096 Dec 11 23:27 nginx-1.2.7

압축 해제한 Nginx 디렉토리로 이동하여 Build 를 진행합니다.

[mwchoi-vm01:/data/nginx]# ls -l

total 4

drwxr-xr-x. 8 1001 1001 4096 Dec 11 23:27 nginx-1.2.7

[mwchoi-vm01:/data/nginx]# cd nginx-1.2.7/

Page 6: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 6 4/2/2013

[mwchoi-vm01:/data/nginx/nginx-1.2.7]# ls -l

total 568

drwxr-xr-x. 6 1001 1001 4096 Apr 2 14:20 auto

-rw-r--r--. 1 1001 1001 213065 Dec 11 23:27 CHANGES

-rw-r--r--. 1 1001 1001 324660 Dec 11 23:27 CHANGES.ru

drwxr-xr-x. 2 1001 1001 4096 Apr 2 14:20 conf

-rwxr-xr-x. 1 1001 1001 2369 Aug 7 2012 configure

drwxr-xr-x. 3 1001 1001 4096 Apr 2 14:20 contrib

drwxr-xr-x. 2 1001 1001 4096 Apr 2 14:20 html

-rw-r--r--. 1 1001 1001 1397 Aug 7 2012 LICENSE

drwxr-xr-x. 2 1001 1001 4096 Apr 2 14:20 man

-rw-r--r--. 1 1001 1001 49 Oct 31 2011 README

drwxr-xr-x. 8 1001 1001 4096 Apr 2 14:20 src

[mwchoi-vm01:/data/nginx/nginx-1.2.7]#

Prefix를 이용하여 configure를 실행시킵니다.

[mwchoi-vm01:/data/nginx/nginx-1.2.7]# ./configure \

> --prefix=/data/nginx \

> --sbin-path=/data/nginx/bin/nginx \

> --conf-path=/data/nginx/conf/nginx.conf \

> --pid-path=/data/nginx/pid/nginx.pid \

> --lock-path=/data/nginx/lock/nginx \

> --error-log-path=/data/nginx/logs/error.log \

> --http-log-path=/data/nginx/logs/access.log \

> --http-client-body-temp-path=/data/nginx/tmp/client/ \

> --http-proxy-temp-path=/data/nginx/tmp/proxy/ \

> --http-fastcgi-temp-path=/data/nginx/tmp/fcgi/ \

> --http-uwsgi-temp-path=/data/nginx/tmp/uwsgi/ \

> --http-scgi-temp-path=/data/nginx/tmp/scgi/ \

> --with-http_ssl_module \

> --with-http_realip_module \

> --with-http_addition_module \

> --with-http_sub_module \

> --with-http_dav_module \

> --with-http_flv_module \

> --with-http_gzip_static_module \

> --with-http_stub_status_module \

> --with-http_perl_module \

> --with-http_geoip_module

[mwchoi-vm01:/data/nginx/nginx-1.2.7]# make

[mwchoi-vm01:/data/nginx/nginx-1.2.7]# make install

설치가 모두 되었다면 디렉토리를 확인합니다.

[mwchoi-vm01:/data/nginx]# ls -l

Page 7: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 7 4/2/2013

total 24

drwxr-xr-x. 2 root root 4096 Apr 2 15:00 bin

drwxr-xr-x. 2 root root 4096 Apr 2 15:00 conf

drwxr-xr-x. 2 root root 4096 Apr 2 15:00 html

drwxr-xr-x. 2 root root 4096 Apr 2 15:00 logs

drwxr-xr-x. 2 root root 4096 Apr 2 15:00 pid

drwxr-xr-x. 2 root root 4096 Apr 2 15:01 tmp

[mwchoi-vm01:/data/nginx]#

2.5 Nginx의 시작

설치 완료가 된 상태에서 서버를 기동합니다.

[mwchoi-vm01:/data/nginx]# cd bin

[mwchoi-vm01:/data/nginx/bin]# ls -l

total 5288

-rwxr-xr-x. 1 root root 5414275 Apr 2 15:00 nginx

[mwchoi-vm01:/data/nginx/bin]# ./nginx

Page 8: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 8 4/2/2013

2.6 Nginx 작동 상태 점검하기

[mwchoi-vm01:/data/nginx/bin]# ps –ef|grep nginx

root 20165 1 0 15:01 ? 00:00:00 nginx: master process nginx

nobody 20166 20165 0 15:01 ? 00:00:00 nginx: worker process

root 20228 14774 0 15:08 pts/1 00:00:00 grep nginx

브라우저를 통한 Nginx Index 페이지를 확인합니다.

2.7 Nginx의 정지

서버를 중지하기 위해서는 다음의 명령어를 통해 진행합니다.

[mwchoi-vm01:/data/nginx/bin]# ps -ef|grep nginx

root 21103 1 0 16:47 ? 00:00:00 nginx: master process ./nginx

nobody 21104 21103 0 16:47 ? 00:00:00 nginx: worker process

root 21109 14774 0 16:47 pts/1 00:00:00 grep nginx

[mwchoi-vm01:/data/nginx/bin]# ./nginx -s stop

[mwchoi-vm01:/data/nginx/bin]# ps -ef|grep nginx

root 21115 14774 0 16:48 pts/1 00:00:00 grep nginx

[mwchoi-vm01:/data/nginx/bin]#

Page 9: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 9 4/2/2013

3 Nginx 설치 승인

Prepared by __________________________________

Middleware Consultant, Open Source Consulting, Inc.

Approved by __________________________________

Project Manager

Page 10: [오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1

Confiugration Report

Confidential Page 10 4/2/2013

4 APPENDICES

4.1 Document Guidelines

http://wiki.nginx.org/Main

4.2 Project Migration Report Sections Omitted

N/A