CentOs7.6安装nginx yum安装
- 添加yum源
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
- 安装
sudo yum install -y nginx
- 重启服务
sudo systemctl start nginx.service
- 设置开机启动
sudo systemctl enable nginx.service
- 防火墙放开80端口
firewall-cmd --add-port=80/tcp --permanent
- 重新加载防火墙
firewall-cmd --reload