1、软件包管理

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

CentOS 5,就用下面的源:

1
rpm -ivh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

Red Hat Enterprise Linux 6:

1
rpm -ivh http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm

Red Hat Enterprise Linux 5:

1
rpm -ivh http://nginx.org/packages/rhel/5/noarch/RPMS/nginx-release-rhel-5-0.el5.ngx.noarch.rpm

2、安装

1
yum install nginx

3、启动

1
service nginx start

4、测试

访问:http://127.0.0.1/