1. 查看yum源中yum info nginx 是不是1.4nginx
yum info nginx
若是沒有nginx或者nginx版本比較低,個人阿里雲yum源版本過低,因此須要增長新的nginx的yum源centos
yum install http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
安裝過程當中輸入y 回車就行了,安裝成功後運行yum info nginx
查看nginx版本是否正確。ruby
2. yum安裝nginx阿里雲
yum install nginx
3. 設置nginx開機啓動spa
chkconfig nginx on
4. 啓動nginx3d
service nginx start
5. 關閉nginxcode
service nginx stop