使用yum 安装 nginx

说明

阿里云镜像的nginx 的版本为11.20.1-10.el7正常使用也没啥问题,如果想要安装新的,则需要添加nginx源

配置Nginx源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装

1
2
3
4
5
yum install -y nginx
systemctl enable nginx #设置开机启动
systemctl start nginx
systemctl stop nginx
systemctl restart nginx

引用