728x90
설치 환경
SW | 버 전 |
Ubuntu | 22.0.4LTS |
Nginx | 1.25.1 |
설치 요구사항
OS 라이브러리 설치
$ apt-get install -y gcc
$ apt-get install -y g++
$ apt-get install -y libssl-dev
$ apt-get install -y lynx
$ apt-get install -y make
$ apt-get install -y libexpat1-dev
$ apt-get install -y zlib1g-dev
Nginx 설치
Nginx 파일 다운 후 압축해제, nginx-1.25.1 디렉토리가 ${NGINX_HOME} 디렉토리가 된다.
$ http://nginx.org/download/nginx-1.25.1.tar.gz
$ tar -zxvf nginx-1.25.1.tar.gz
apr, apr-util 라이브러리 설치
- APR이란?
Apache Portable Runtime은 Apache HTTP 서버의 2.x의 핵심이며 휴대용 라이브러리 이다. APR은 고급 IO 기능에 대한 접근을 포함 하며 OS 수준의 기능(난수 생성, 시스템 상태) 그리고 기본 프로세스 처리(공유 메모리, NT 파이프와 유닉스 소켓)등 많은 용도로 사용한다. - 라이브러리 설치
$ apt-get install -y libapr1
$ apt-get install -y libaprutil1
pcre 설치
$ cd ${NGINX_HOME}
# pcre 다운로드
$ wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
# 압축해제
$ tar -zxvf pcre-8.45.tar.gz
# pcre 디렉토리 이동하여 생성 확인
$ cd /pcre-8.45
zlib 설치
# zlib 다운로드
$ wget https://zlib.net/current/zlib.tar.gz
# zlib 압축해제
$ tar -zxvf zlib.tar.gz
# zlib 디렉토리 확인
$ cd /zlib-1.2.13
OpenSSL 설치
# openssl 다운로드
$ wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1n.tar.gz
# 압축해제
$ tar -zxvf openssl-1.1.1n.tar.gz
# nginx home에 openssl 디렉토리 생성
$ cd ${NGINX_HOME}
$ mkdir openssl
# openssl 압축해제한 디렉토리 확인
$ cd /openssl-1.1.1n
Nginx 빌드
# nginx configure
./configure --prefix=/sw/web/nginx --user=web --group=web --with-pcre=/sw/web/pcre-8.45 --with-zlib=/sw/web/zlib-1.2.13/ --with-openssl=/sw/web/openssl-1.1.1n --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module
# 설치
$ make
$ make install
Nginx 설치 확인
$ nginx -v
# version 확인됨
nginx version: nginx/1.25.1
환경 설정
Nginx 사용 편의를 위해 아래와 같이 설정
export NGINXDIR=/sw/web/nginx
export PATH="${NGINXDIR}/sbin:${PATH}"
alias nhome='cd ${NGINXDIR}'
alias ncfg='cd ${NGINXDIR}/conf'
alias nbin='cd ${NGINXDIR}/sbin'
alias nlog='cd /logs/nginx'
alias napp='cd ${NGINXDIR}/app'
728x90
'WEB > Nginx' 카테고리의 다른 글
[Nginx] 설정 파일 (0) | 2024.10.31 |
---|---|
[Nginx] 업로드 파일 용량 초과 오류 (0) | 2024.10.15 |
[Nginx]기동 및 다운 (0) | 2023.07.26 |