sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install -y nginx
直到出现 Complete! nginx
sudo systemctl start nginx.service
启动后在浏览器上访问,网页出现如下内容说明安装成功。centos
查看版本:nginx -v浏览器
查看nginx安装目录:ps -ef | grep nginxspa
检查配置文件:nginx -trest
启动:systemctl start nginx.servicecode
中止:systemctl stop nginx.serviceblog
重启:systemctl restart nginx.serviceit
设置开机自启动:systemctl enable nginx.serviceclass
中止开机自启动:systemctl disable nginx.service配置
查看当前状态:systemctl status nginx.service
查看全部已启动的服务:systemctl list-units --type=service