建立 nginx.repo 文件nginx
$ cd /etc/repos.d/ $ vim nginx.repo #寫入如下內容 [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key
安裝vim
$ yum -y install nginx
啓動centos
$ systemctl start nginx.service $ systemctl enable nginx.service