CentOS 7 安装Nginx

本文安装官方网站的教程安装 https://nginx.org/en/linux_packages.html#RHEL-CentOS

1、To set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents:

  新建/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

[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

 

2、By default, the repository for stable nginx packages is used. If you would like to use mainline nginx packages, run the following command:

  由于默认用的不是稳定版本,可以使用命令 

1 sudo yum-config-manager --enable nginx-mainline

切换到稳定版本

3、To install nginx, run the following command:

1 sudo yum install nginx

When prompted to accept the GPG key, verify that the fingerprint matches 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62, and if so, accept it.

安装过程中注意核对证书

 

启动nginx

1 systemctl start nginx

 

转载于:https://www.cnblogs.com/BD1A489/p/10933163.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值