centos7踩坑(四) 安装nginx

Nginx安装

  • 添加yum源
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
  • 安装nginx
yum install nginx

Nginx服务

#设置开机启动
systemctl enable nginx

#启动服务
systemctl start nginx

#重启服务
systemctl restart nginx

#查看服务状态
systemctl status nginx

你可能感兴趣的:(centos7踩坑(四) 安装nginx)