#更新nginx官方yum源 http://nginx.org/en/linux_packages.html#RHEL-CentOS
#编辑以下信息到文件 /etc/yum.repos.d/nginx.repo
vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
#安装软件
yun install -y nginx
#启动服务
systemctl start nginx #CentOS7
systemctl enable nginx #CentOS7
#查看服务状态
systemctl status nginx #CentOS7
yum官方源安装nginx CentOS7
最新推荐文章于 2024-07-31 15:46:37 发布