nginx 최신 버전 설치하기

아침7시개발·2022년 6월 16일
0

nginx

목록 보기
2/3

NGINX 최신(안정 버전) 버전 설치하기

EPEL 및 YUM Utilities 패키지 설치

$ yum install -y epel-release yum-utils

nginx.repo 파일 생성

$ vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=https://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

nginx-stable 저장소를 활성화

$ yum-config-manager --enable nginx-stable

설치전 nginx 버전 확인

$ yum info nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * epel: nrt.edge.kernel.org
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Available Packages
Name        : nginx
Arch        : x86_64
Epoch       : 1
Version     : 1.21.1
Release     : 1.el7.ngx
Size        : 790 k
Repo        : nginx-mainline/7/x86_64
Summary     : High performance web server
URL         : https://nginx.org/
License     : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
            : a mail proxy server.

nginx 설치

$ yum install -y nginx

nginx 버전 확인

$ nginx -v
nginx version: nginx/1.21.4

nginx 서비스를 시작하고 부팅 시 자동으로 시작하도록 활성화

$ systemctl --now enable nginx

nginx 버전 정보 숨기기

$ vim /etc/nginx/nginx.conf
http {
...
    server_tokens off;
...
}

출처

변군이글루(Mirror Site)

profile
쉬엄쉬엄하는 개발자

0개의 댓글