一、yum 方式安装
1.安装yum工具
sudo yum install yum-utils
2. 安装epel
yum install epel-release
3.安装nginx:
yum install nginx
4.查看版本
nginx -v
5.设置开机自启动
systemctl enable nginx
nginx 常用命令:
1)启动nginx
systemctl start nginx2)停止服务
systemctl stop nginx
3)重启服务
systemctl restart nginx
4)重新加载
systemctl reload nginx