centos直接yum安装nginx

centos 6.3,直接yum  install nginx 不行,要先处理下源。

1、CentOS 6,先执行:
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2,查看yum的nginx信息

# yum info nginx

.ngx.noarch.rpm

Retrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

warning: /var/tmp/rpm-tmp.0W2VAv: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY

Preparing...                ########################################### [100%]

  1:nginx-release-centos   ########################################### [100%]

[root@localhost profile.d]# yum info nginx

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* base: mirrors.yun-idc.com

* extras: mirrors.yun-idc.com

* updates: mirrors.yun-idc.com

nginx                                                                                    | 2.9 kB     00:00    

nginx/primary_db                                                                         |  26 kB     00:00    

Available Packages

Name        : nginx

Arch        : x86_64

Version     : 1.4.5

Release     : 1.el6.ngx

Size        : 311 k

Repo        : nginx

Summary     : High performance web server

URL         : http://nginx.org/

License     : 2-clause BSD-like license

Description : nginx [engine x] is an HTTP and reverse proxy server, as well as

           : a mail proxy server.


[root@localhost profile.d]# yum install nginx

[root@localhost profile.d]#service nginx start

正在启动 nginx:                                           [确定]

4,然后进入浏览器,输入http://192.168.1.5/测试,如果看到

Welcome to nginx!

成功!

你可能感兴趣的:(centos,yum,ngixn)