1、更新源
shell
sudo yum install -y epel-release
sudo yum -y update
2、安装nginx
shell
sudo yum install -y nginx
3、操作nginx
shell
# 启动
systemctl start nginx
# 停止
systemctl stop nginx
# 重启
systemctl restart nginx
# 查看状态
systemctl status nginx
# 开机启动
systemctl enable nginx
# 禁止开机启动
systemctl disable nginx