Centos 7 Yum安裝 Nginx

Centos7 yum 安裝Nginx:

1.添加Nginx Repository

1nginx

yum install epel-releasespa

2.安裝Nginx

1code

yum install nginxblog

3.啓動Nginx服務:

1get

systemctl start nginxcmd

若是開着防火牆,請運行以下命令:it

1table

2service

3防火牆

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

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

firewall-cmd --reload

 

4.訪問IP地址:

1

http://IP/

若是能看到此頁面則說明nginx運做正常!
nginx_default

5.開機自動啓動Nginx

1

systemctl enable nginx

相關文章
相關標籤/搜索