码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS7 YUM 安装NGINX

时间:2016-01-03 12:59:39      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

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)显示如下:

技术分享

 

参考文献:

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

CentOS7 YUM 安装NGINX

标签:

原文地址:http://www.cnblogs.com/asmer-stone/p/5095989.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!