1.先添加源:

1 nano /etc/yum.repos.d/nginx.repo
把下边这段代码添加到nginx.repo中去。
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=1 enabled=1

2.添加签名:

1 wget: http://nginx.org/keys/nginx_signing.key
2 sudo rpm --import nginx_signing.key

3.更新源:

1 sudo yum update

4.安装:

1 sudo yum install nginx

5.启动:

nginx  #启动

#  nginx -s quit/reload/reopen/stop
#  quit – Shut down gracefully
#  reload – Reload the configuration file
#  reopen – Reopen log files
#  stop – Shut down immediately (fast shutdown)

 

完成:

浏览器中输入服务器地址(本机:127.0.0.1)显示如下:

CentOS7 YUM 安装NGINX

 

参考文献:

installing nginx open source: https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/

nginx:linux packages: http://nginx.org/en/linux_packages.html

相关文章:

  • 2021-11-10
  • 2021-11-19
  • 2022-12-23
  • 2021-08-18
  • 2022-01-23
  • 2021-09-06
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2021-07-01
  • 2021-08-25
  • 2022-12-23
  • 2018-07-26
  • 2021-11-25
  • 2021-11-05
相关资源
相似解决方案