Linux Centos7下通过yum源安装Nginx

环境准备

Linux发行版本:Centos7

增加nginx yum源

  1. 进入到yum源配置目录,创建文件nginx.repo,增加yum源信息
[admin@localhost yum.repos.d]$ cd /etc/yum.repos.d
[admin@localhost yum.repos.d]$ vim nginx.repo
[admin@localhost yum.repos.d]$ cat 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

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

安装Nginx

现在Nginx yum源已经安装在您的服务器上,使用以下yum命令安装Nginx :

[admin@localhost yum.repos.d]$ sudo yum install nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirror.jdcloud.com
 * updates: ap.stykers.moe
nginx-stable                                                                                                                                                        | 2.9 kB  00:00:00     
nginx-stable/7/x86_64/primary_db                                                                                                                                    |  50 kB  00:00:03     
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.16.1-1.el7.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值