WEB Server - NGINX Comfile 설치하기 - CentOS 7




    이번 포스팅에서는 Nginx 설치에 대해서 알아보도록 하겠습니다




    이전 글 :


    서버와 클라이언트 그리고 HTTP - https://server-talk.tistory.com/291 


    WEB Server - NGINX 알아보기 - https://server-talk.tistory.com/297







     

     NGINX 다운로드

     



    Nginx - 공식 홈페이지 URL : http://nginx.org/ 

     
    Nginx - 공식 홈페이지 다운로드 URL : https://nginx.org/en/download.html






    NGINX 버전 종류


    Mainline version(안정버전) : 실제로 서비스를 진행한다면 이 버전을 사용합니다


    Stable version(개발 버전) : 개발 버전으로 버그의 발생과 공식적으로 버그에 대한 지원이 없으며, 이 버전보다는 안정 버전을 권장합니다


    Legacy versions(구 버전) : 서버 운영중 예전 버전이 필요할 경우 사용합니다




     

     NGINX Comfile 설치하기

     


    1) Nginx 설치 및 가동에 필요한 패키지 설치


    [root@nginx ~]# yum -y install pcre-devel libxml2-devel zlib zlib-devel openssl openssl-devel gcc g++ cpp gcc-c++ libxslt libxslt-devel php-gd libgd-dev gd gd-devel perl perl-ExtUtils-Embed geoip-devel
    


    2) PCRE 압축해제


    pcre-8.44.tar.gz


    [root@nginx ~]# tar zxf pcre-8.44.tar.gz
    



    3) zlib 압축해제


    zlib-1.2.11.tar.gz


    [root@nginx ~]# tar zxf zlib-1.2.11.tar.gz
    



    4) openssl 압축해제


    openssl-1.1.1g.tar.gz

    [root@nginx ~]# tar zxf openssl-1.1.1g.tar.gz
    



    5) Nginx Daemon 계정생성

    [root@nginx ~]# useradd --shell /sbin/nologin nobody
    




    6) Nginx 소스트리 구성


    Nginx File : nginx-1.18.0.tar.gz


    [root@nginx ~]# tar zxf nginx-1.18.0.tar.gz
    [root@nginx ~]# cd nginx-1.18.0
    [root@nginx nginx-1.18.0]# ./configure \
    --prefix=/usr/local/nginx \
    --user=nobody \
    --group=nobody \
    --with-openssl=../openssl-1.1.1g \
    --with-zlib=../zlib-1.2.11 \
    --with-pcre=../pcre-8.44 \
    --with-http_ssl_module \
    --with-http_realip_module \
    --with-http_addition_module \
    --with-http_xslt_module \
    --with-http_image_filter_module \
    --with-http_geoip_module \
    --with-http_sub_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_mp4_module \
    --with-http_gzip_static_module \
    --with-http_random_index_module \
    --with-http_secure_link_module \
    --with-http_stub_status_module \
    --with-http_perl_module \
    --with-http_degradation_module \
    --with-http_gunzip_module \
    --with-http_auth_request_module \
    --with-http_v2_module
    


    위 Nginx 컴파일 소스트리 구성은 폭넓게 열어 놓은 옵션입니다.



    NGINX 구성 요소 옵션


    --prefix=/usr/local/nginx : 설치경로 옵션


    --user=nobody : Nginx 프로세스 기본 사용자계정 옵션


    --group=nobody : Nginx 프로세스 기본 사용자그룹 옵션


    --with-http_ssl_module : SSL 모듈 활성화 옵션


    --with-http_realip_module : 실제 IP 주소를 요청의 헤더 데이터에서 읽는 Real IP 모듈 활성화 옵션


    --with-http_addition_module : 응답 본문 앞이나 뒤에 데이터를 덧붙일 수 있는 Addition 모듈 활성화 옵셥


    --with-http_xslt_module : XML 문서에 XSL 변환을 적용하는 XSLT 모듈 활성화 옵션


    --with-http_image_filter_module : 이미지를 수정하는 이미지 필터 모듈 활성화 옵션


    --with-http_geoip_module : 국가별로 접속 가능하게 하는 모듈 활성화 옵션


    --with-http_sub_module : 웹페이지의 문자를 바꾸는 대체 모듈 활성화 옵션


    --with-http_dav_module : WebDAV 모듈 활성화 옵션


    --with-http_flv_module : 플래시 비디오 파일을 처리하는 FLV 모듈 활성화 옵션


    --with-http_mp4_module : .MP4 비디오 파일을 처리하는 MP4 모듈 활성화 옵션


    --with-http_gzip_static_module : 압축된 파일을 전송하는 정적 GZIP 모듈 활성화 옵션


    --with-http_random_index_module : 임의의 파일을 디렉터리 색인 파일로 무작위 색일 모듈 활성화 옵션


    --with-http_secure_link_module : URL에 키워드 유무를 확인하는 보안 링크 모듈 활성화 옵션


    --with-http_stub_status_module : 서버 통계와 정보 페이지를 생성하는 모듈 활성화 옵션


    --with-http_perl_module : perl 모듈을 활성화하여 perl 코드를 Nginx 구성파일에 직접 삽입하고 SSI에서 perl

    을 호출



    --with-http_degradation_module : 자원 사용량에 따라 서버의 동작을 제어하는 저감 모듈 활성화 옵션


    --with-http_gunzip_module : gzip으로 압축해서 보내온 음답을 클라이언트에게 전달하기 전에 복원하는 Gunzip 모듈 활성화 옵션


    --with-http_auth_request_module : 클라이언트 인증, 서버인증 등으로 인증할수 있는 모듈 활성화 옵션


    --with-http_v2_module : HTTP/2 지원 모듈 활성화 옵션





    7) Nginx 설치시작



    [root@nginx ~]# make && make install
    





    8) Nginx Daemon 시작


    [root@nginx nginx-1.18.0]# /usr/local/nginx/sbin/nginx
    





    Posted by 서버이야기