#### 1.因为CentOS默认不提供Nginx的Repo信息,所以需要手动添加才可以安装,命令如下。 ```shell sudo rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm ``` #### 2.查看哪些Nginx版本可以安装 ```shell sudo yum --showduplicates list Nginx ``` #### 3.执行安装命令 ```shell sudo yum install nginx.x86_64 ``` #### 4.设置随系统启动 ```shell systemctl enable Nginx.service ``` #### 5.启动Nginx ```shell systemctl start Nginx.service ```