Nginx 에 대해 공부가 필요하다 느껴 Nginx를 우분투 환경에서 설치해 본다.

[환경]
AWS EC2 - Ubuntu

[GCC & make 설치]
초기 EC2 우분투에서는 GCC (C 컴파일러)가 없으므로 설치한다.
make 도 설치한다.
sudo apt-get install gcc -y;
sudo apt-get install make -y;



[Nginx 다운로드]
nginx.org 에 접속하면 원하는 버전의 nginx를 다운로드 할 수 있거나 링크를 복사 할 수 있다.

나는 nginx 파일을 서버에서 받을 예정이므로 링크를 복사후 우분투에서 다운로드 한다.

sudo wget http://nginx.org/download/nginx-1.15.2.tar.gz



압축풀기

tar xzvf ./nginx-1.15.2.tar.gz 



[pcre 패키지 / ssl module / libperl-dev 설치]

sudo apt-get install libpcre3-dev -y;
sudo apt-get install libssl-dev -y;
sudo apt-get install libperl-dev -y;



[nginx 설치]
1. 컴파일

./configure --prefix=/engn/nginx/1.15.2/servers/webd-instance_80 \
--conf-path=/engn/nginx/1.15.2/servers/webd-instance_80/conf/nginx.conf \
--with-debug \
--wiht-http_ssl_module \
--with-http_realip_module \
--with-http_perl_module \
--with-http_stub_status_module;
sudo make install;


3. nginx 심볼릭 링크 걸기 (옵션)

ln -s /engn/nginx/1.15.2/servers/webd-instance_80/sbin/nginx /usr/sbin/nginx



4. nginx -v 로 버전을 확인한다.

[nginx 기동/종료]
1. 기동: nginx -s reload
2. 종료: nginx -s stop








'Nginx' 카테고리의 다른 글

[우분투_Nginx] 80 포트 일반계정으로 실행  (0) 2018.08.27

+ Recent posts