执行命令:
vi /etc/yum.repos.d/nginx.repo
添加如下内容:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1
yum update
yum install nginx
systemctl enable nginx
sudo systemctl start nginx
systemctl status nginx
systemctl stop nginx
systemctl restart nginx
/etc/nginx/conf.d/default.conf
nginx -t
nginx -s reload
查看端口占用: netstat -tlp