CentOS 6安装nginx

  |   Nginx Linux

直接yum install nginx就不行了,所以我们需要先处理下源。

查看yum的nginx信息

[root@vps19677438 /]# yum info nginx
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.netonboard.com
 * extras: centos.netonboard.com
 * updates: centos.netonboard.com
错误:没有匹配的软件包可以列出

添加nginx到yum源

[root@vps19677438 /]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Retrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

然后yum安装nginx就ok

yum install nginx -y