原创

CentOS 7 安装nginx

1.直接安装nginx

[root@bogon bin]# yum install nginx
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ap.stykers.moe
 * extras: mirror.bit.edu.cn
 * updates: ap.stykers.moe
没有可用软件包 nginx。
错误:无须任何处理

2.常规操作先安装一下nginx的yum源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

nginx:[root@bogon bin]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
获取http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
警告:/var/tmp/rpm-tmp.3V2tYM: 头V4 RSA/SHA1 Signature, 密钥 ID 7bd9bf62: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:nginx-release-centos-7-0.el7.ngx ################################# [100%

完成!开始安装了

3.yum install -y nginx

4.
[root@bogon bin]# nginx -v nginx version: nginx/1.16.0

这就完成了!

正文到此结束
本文目录