centos7系統庫中默認是沒有nginx的rpm包的,因此咱們本身須要先更新下rpm依賴庫nginx
(1)使用yum安裝nginx須要包括Nginx的庫,安裝Nginx的庫centos
#rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmcentos7
(2)使用下面命令安裝nginxget
#yum install nginxclass
(3)啓動Nginxservice
#service nginx startyum
或di
#systemctl start nginx.servicevi