yum安装Nginx的方法


yum安装Nginx的方法

  1. 添加源
1
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
  1. 安装Nginx
1
sudo yum install -y nginx
  1. 启动Nginx并设置开机自动运行
1
2
sudo systemctl start nginx.service
sudo systemctl enable nginx.service