리눅스 NGNIX 설치
mkdir etc/yum/repos.d/
Vi etc/yum/repos.d/nginx.repo
[nginx]
name=nginx
repo baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
//저장소 추가
yum install nginx –y
//nginx 설치
Yum install iptables-services
//iptables 설치
Systemctl stop firewalld.service
Systemctl disable firewalld.service
Vi /etc/sysconfig/iptables
-A INPUT –m state - -state NEW –m tcp –p tcp - - dport 8080 –j ACCEPT
-A INPUT –m state - -state NEW –m tcp –p tcp - - dport 80 –j ACCEPT
//방화벽 끄고 포트 개방
Service iptables save
Systemctl restart iptables.service
Cp /etc/nginx/nginx.com /etc/nginx/conf.d/default.conf
Vi /etc/nginx/nginx.com
Vi /etc/nginx/conf.d/default.conf
Systemctl restart nginx
Systemctl enable nginx
//재시작 및 활성화
Vi /usr/share/nginx/html/index.html
//내용을 모두 삭제하고 html를 직접 짠다.
Systemctl restart nginx
http://내ip 접속하여 확인한다.
'OS > Linux' 카테고리의 다른 글
[Centos8] glance 설치 (0) | 2020.12.24 |
---|---|
[리눅스 명령어] APM 웹 서버 (0) | 2020.12.17 |
[RAID 명령어 1편] fdisk / parted (0) | 2020.12.17 |
[리눅스 명령어] KILL, WHO, W, rc.local (0) | 2020.12.17 |
[리눅스 명령어] XFS, EXT, 저널링, SWAP 파일 시스템 (0) | 2020.12.17 |