나만보는개발공부블로그

[CentOS] Nginx 설치 본문

Web Development/Back

[CentOS] Nginx 설치

alexrider94 2021. 2. 6. 09:51

Nginx 설치

systemctl enable nginx
yum install -y nginx

- nginx 저장소가 없을시

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

이후에 baseurl 내용에 os version에 맞게 설정

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

 

http 방화벽 설정

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --reload

만약 FirewallD is not running error

systemctl start firewalld

 

nginx 부팅 확인

systemctl start nginx

부팅시 자동시작 설정

systemctl enable nginx