在centos6下需要增加文件/etc/yum.repos.d/nginx.repo
内容为:
[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
然后执行yum install nginx
进行安装
安装完查看是否安装成功nginx -v
确认状态service nginx status
,最后执行service nginx start
开启nginx