1、Centos6系统库中默认是没有nginx的rpn包的,所以我们需要先更新下rpm依赖库
(1):使用yum安装nginx,安装nginx库
rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
(2):使用下面命令安装nginx
yum -y install nginx
(3):启动nginx
service nginx start
(4):设置终端模式开机启动
chkconfig nginx on