1. Nginx 디렉토리 생성
sudo mkdir /usr/local/nginx
cd /usr/local/nginx
2. 설치파일 다운로드
[nginx]
sudo wget https://nginx.org/download/nginx-1.12.0.tar.gz
sudo tar -xvf nginx-1.12.0.tar.gz
[PCRE]
sudo wget http://downloads.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz
sudo tar -zxf pcre-8.37.tar.gz
[zlib]
sudo wget https://zlib.net/zlib-1.2.13.tar.gz
sudo tar -zxf zlib-1.2.13.tar.gz
(링크가 깨졌으면 https://zlib.net 에 접속하여 최신버전을 다운받는다)
[OpenSSL]
sudo wget http://www.openssl.org/source/openssl-1.0.2f.tar.gz
sudo tar -zxf openssl-1.0.2f.tar.gz
[root 권한]
sudo chown -R root:root /usr/local/nginx
sudo apt install gcc
sudo apt install build-essential
3. Nginx 설치
cd /usr/local/nginx
sudo mv pcre-8.37 ./nginx-1.12.0
sudo mv zlib-1.2.13 ./nginx-1.12.0
sudo mv openssl-1.0.2f ./nginx-1.12.0
cd /usr/local/nginx/nginx-1.12.0/
sudo ./configure --prefix=/usr/local/nginx --with-zlib=./zlib-1.2.13 --with-pcre=./pcre-8.37 --with-openssl=./openssl-1.0.2f --with-http_ssl_module --with-http_stub_status_module
sudo make install
4. Nginx 실행
cd /usr/local/nginx/nginx-1.12.0
************************************
cd /usr/local/nginx/sbin
sudo chown root nginx
sudo chmod +s nginx
************************************
[시작]
./nginx
[종료]
./nginx -s stop
[참고]
'Infra Structure > Nginx' 카테고리의 다른 글
[Nginx] TCP/UDP reverse proxy (0) | 2022.10.21 |
---|---|
[Nginx] 무중단 배포 (0) | 2022.07.13 |
[Nginx] SSL 적용 (0) | 2022.07.11 |
[Nginx] docker로 Nginx 설치 (0) | 2022.07.03 |
[Nginx] Load Balancing 설정하기 (0) | 2022.06.01 |