[NGINX - Server] 설치하기

2021. 3. 17. 23:38 Server, WAS/nginx

1) 다운받을 저장소 등록

# yum install -y yum-utils

vi /etc/yum.repos.d/nginx.repo

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

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

 

 

2) 설치하기

# yum-config-manager --enable nginx-mainline

# yum install -y nginx

 

 

3) 포트허용 (http : 80, https : 443)

# firewall-cmd --permanent --zone=public --add-service=http

# firewall-cmd --permanent --zone=public --add-service=https

# firewall-cmd --reload

 

 

4) 서비스 재시작

# systemctl restart nginx

# systemctl enable nginx

 

 

5) 셀리눅스 보안해제

# setsebool -P httpd_can_network_connect 1

 

출처 : know-one-by-one.tistory.com/86

'Server, WAS > nginx' 카테고리의 다른 글

[NGINX - Server] NGINX + Node 연동하기  (0) 2021.03.17
맥에서 nginx 설치 및 설정  (0) 2019.12.24