以下是在 CentOS 7.9 上安装 Nginx 的步骤:

  1. 更新系统:
sudo yum update
  1. 安装 EPEL 源:
sudo yum install epel-release
  1. 安装 Nginx:
sudo yum install nginx
  1. 启动 Nginx 服务:
sudo systemctl start nginx
  1. 设置 Nginx 开机自启动:
sudo systemctl enable nginx
  1. 检查 Nginx 是否已经启动:
sudo systemctl status nginx
  1. 配置防火墙,允许 Nginx 访问:
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

现在,您已经成功安装了 Nginx,并且可以通过浏览器访问您的服务器 IP 地址,以验证是否正常工作。

centos79 安装nginx

原文地址: https://www.cveoy.top/t/topic/K9r 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录