安装epel-release源并进行安装
yum
install
epel-release
![](https://i-blog.csdnimg.cn/blog_migrate/061189973e9ba776a150a0517481e7d6.png)
yum update(时间会有点长)
![](https://i-blog.csdnimg.cn/blog_migrate/a19e2e082d79ec0c6e32e98f449a39b0.png)
yum
install
nginx
![](https://i-blog.csdnimg.cn/blog_migrate/d88c86ea1166169f9774323a8d7a606c.png)
相关操作:
systemctl status nginx
#查看运行状态
systemctl start nginx
#启动
systemctl stop nginx
#停止
systemctl restart nginx
#重启
systemctl
enable
nginx
#开机启动
![](https://i-blog.csdnimg.cn/blog_migrate/97c1faf987e8658987ea410beaaef202.png)
设置防火墙
在启动完以后可能无法通过IP访问,需要进一步设置防火墙
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload