阿裏雲centos7 安裝nginx
1.添加yum源(參考官方文檔)
To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “6” or “7”, for 6.x or 7.x versions, respectively.
centos7的yum正確姿勢是這樣:
[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
2.使用yum安裝nginx
yum install nginx
3.查看nginx配置文件
cd /etc/nginx
最後更新:2017-10-07 23:04:04