entOS에 Nginx 설치를 해보자.
http://nginx.org/ 에서 파일을 내려받자
root권한으로 하면..안되지만, 개인 가상머신이니 ..일단 에헴;
최신버전을 다운 받아보자
wget http://nginx.org/download/nginx-1.9.9.tar.gz
받았으면 압축도 풀고..
tar zxvf nginx-1.9.9.tar.gz
설치될 경로는 미리 만들어두자.. 필자는
/kani/program/nginx 경로에 설치할 예정이다.
압축을 풀고
cd nginx-1.9.9
./configure --prefix=/kani/program/nginx
.
.
.
뻐킹 에러다.
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
./configure --prefix=/kani/program/nginx
.
.
.
./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
좋아.
make && make install
컴파일 완료 후
이동해보자
cd /kani/program/nginx
오우케이
그럼 덤으로 실행
sbin/nginx
프로세스가 올라갓는지 확인
ps -ef | grep nginx
끝.
* 확인하려면 80번 포트의 방화벽을 열어서 브라우저로 확인해보거나 curl, wget등으로 확인해보자.