"Nginx"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글
잔글
32번째 줄: 32번째 줄:
 
mkdir -p /etc/nginx/sites-enabled
 
mkdir -p /etc/nginx/sites-enabled
  
service nginx start
+
|}
 +
 
 +
 
 +
 
 +
<span style="font-size:larger;"><span style="color:#0000FF;">'''Nginx 설정 파일'''</span></span>
 +
 
 +
*/etc/nginx/&nbsp;: 설정 파일 폴더
 +
**nginx.conf
 +
**conf.d/
 +
*/var/log/nginx/&nbsp;: 로그 폴더
 +
**access.log
 +
**error.log
 +
*/usr/share/nginx/html/&nbsp;: Document Root 폴더
 +
 
 +
 
 +
 
 +
<span style="color:#0000FF;"><span style="font-size:larger;">'''기본 설정'''</span></span>
 +
 
 +
vi /etc/nginx/nginx.conf
 +
 
 +
{| cellspacing="1" cellpadding="1" style="line-height: 20.7999992370605px; width: 771px;"
 +
|-
 +
| style="background-color: rgb(241, 241, 241);" |
 +
worker_processes 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#--- core 수만큼 지정
 +
 
 +
gzip on;
 +
 
 +
|}
 +
 
 +
 
 +
 
 +
vi /etc/nginx/conf.d/default.conf
 +
 
 +
{| cellspacing="1" cellpadding="1" style="line-height: 20.7999992370605px; width: 771px;"
 +
|-
 +
| style="background-color: rgb(241, 241, 241);" |
 +
server_name &nbsp;ossnode101.ossbiz.co.kr;
  
 
|}
 
|}
  
<br/>ppp
+
 
 +
 
 +
'''방화벽 설정 및 서비스 기동'''
 +
 
 +
{| cellspacing="1" cellpadding="1" style="line-height: 20.7999992370605px; width: 771px;"
 +
|-
 +
| style="background-color: rgb(241, 241, 241);" |
 +
setup &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #--- 방화벽에서 80/tcp port를 오픈 합니다.
 +
 
 +
service nginx restart
 +
 
 +
|}
 +
 
 +
 
 +
 
 +
브라우저에서 http://ossnode101.ossbiz.co.kr:80/ 으로 접속 합니다.
  
 
==참고 문헌==
 
==참고 문헌==

2014년 9월 18일 (목) 14:34 판

비동기 이벤트 기반의 Web Server인 nginx를 정리 합니다.

nginx 개요

CentOS 6.5에서 설치

Nginx 저장소 생성

vi /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1


Nginx 설치

yum install nginx

mkdir -p /etc/nginx/sites-enabled


Nginx 설정 파일

  • /etc/nginx/ : 설정 파일 폴더
    • nginx.conf
    • conf.d/
  • /var/log/nginx/ : 로그 폴더
    • access.log
    • error.log
  • /usr/share/nginx/html/ : Document Root 폴더


기본 설정

vi /etc/nginx/nginx.conf

worker_processes 1;                #--- core 수만큼 지정

gzip on;


vi /etc/nginx/conf.d/default.conf

server_name  ossnode101.ossbiz.co.kr;


방화벽 설정 및 서비스 기동

setup                                 #--- 방화벽에서 80/tcp port를 오픈 합니다.

service nginx restart


브라우저에서 http://ossnode101.ossbiz.co.kr:80/ 으로 접속 합니다.

참고 문헌