安裝nginx1.16.1版本

安裝nginx1.16.1版本

1、添加源

到 cd /etc/yum.repos.d/ 目錄下
新建nginx.repo 文件nginx

vim nginx.repovim

輸入如下信息centos

[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、安裝Nginx

經過yum search nginx看看是否已經添加源成功。若是成功則執行下列命令安裝nginx。url

yum install -y nginxrest

3、啓動nginxcode

service nginx start
service nginx stop
service nginx restart

5、查看版本,重啓後OK

nginx -vio

nginx version: nginx/1.16.1

service nginx starttable

相關文章
相關標籤/搜索