Jiniya

WEB

리눅스(CentOS)에 Nginx 설치

entOS에 Nginx 설치를 해보자.

 http://nginx.org/ 에서 파일을 내려받자

 

266D25465687858A146740

 

root권한으로 하면..안되지만, 개인 가상머신이니 ..일단 에헴;

최신버전을 다운 받아보자

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

223B6B46568786223D2E7E

 

받았으면 압축도 풀고..

tar zxvf nginx-1.9.9.tar.gz

 

설치될 경로는 미리 만들어두자.. 필자는

/kani/program/nginx 경로에 설치할 예정이다.

 

압축을 풀고

 cd nginx-1.9.9

 ./configure --prefix=/kani/program/nginx

.

.

.

 

2301E839568787B62EAAF2


뻐킹 에러다.

PCRE라이브러리가 없네. 아하하핳

 

./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module by using --without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

statically from the source with nginx by using --with-pcre=<path> option.

 

설치하자.

yum -y install pcre pcre-devel

 

222BC63C568788630B2CE6

 

 

 ./configure --prefix=/kani/program/nginx

.

.

.

23210A34568788E104C1CF

 

./configure: error: the HTTP gzip module requires the zlib library.

You can either disable the module by using --without-http_gzip_module

option, or install the zlib library into the system, or build the zlib library

statically from the source with nginx by using --with-zlib=<path> option.

 

뚜둥..

한번에가자. 어차피 개발용으로도 설치해야한다.

서버 설치후 웹서버 셋팅부터하려는 내가 바보다.

 

yum groupinstall "Development tools"

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

 

 

 

 ./configure --prefix=/kani/program/nginx

 

22359C3A568789F2245D98

좋아.

 

make && make install  

컴파일 완료 후

이동해보자

cd /kani/program/nginx

 

2304553456878A9421AD98

 

오우케이

 

그럼 덤으로 실행

sbin/nginx

 

프로세스가 올라갓는지 확인

ps -ef | grep nginx

 

246D993D56878B2C14744A

 

 

끝.

 

* 확인하려면 80번 포트의 방화벽을 열어서 브라우저로 확인해보거나 curl, wget등으로 확인해보자.