Nginx

1.安装阿里云源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
2.清理缓存
dnf clean all dnf makecache
3.安装Nginx
dnf install nginx -y
4.报错
mv /etc/yum.repos.d/backup /tmp/应该只剩下 CentOS-Base.repo 一个文件。
5、启动服务
Systemctl starts nginx
6、开机自启动
Systemctl enable nginx
7、状态检查
Systemctl status nginx
8、防火墙放行
firewall-cmd --add-service=http --parmanent
--parmanent持久化配置
firewall-cmd --reload
reload无需重启防火墙服务
ss -tlnp | grep :80
检查80端口是否在监听
firewall-cmd --list-all
检查防火墙放行

posted @ 2026-06-15 23:53  小十四先生  阅读(4)  评论(0)    收藏  举报