廢話不多說
1、添加阿里源鏈接
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2、生成緩存,會把新下載CentOS-Base.repo源生效
yum makecache
3、更新源
yum -y update
4、安裝nginx
sudo yum install nginx
5、看下如下內容,安裝完成
6、啓動nginx
sudo systemctl start nginx
7、訪問主頁即可。