To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ gpgcheck=0 enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5”, “6”, or “7”, for 5.x, 6.x, or 7.x versions, respectively.
编辑
#vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
我因为是用的CentOS6.5所以
然后#yum repolist enabled | grep nginx确认repo
然后#yum install nginx
然后#service nginx start
然后http://ip/
看到
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
本文介绍如何在CentOS 6.5上设置Nginx yum仓库并安装启动Nginx服务,通过创建指定的repo文件及配置内容,确保Nginx web服务器成功安装和运行。
2715

被折叠的 条评论
为什么被折叠?



