Nginx是异步框架的网页服务器,也可以用作反向代理、负载平衡器和HTTP缓存。
1.Nginx 包在 EPEL 存储库中可用。如果你还没有安装EPEL 存储库
> yum install epel-release
2.通过yum命令安装 Nginx:
> yum install nginx
3.安装完成后,启用并启动 Nginx 服务:
> systemctl enable nginx //开机启动
> systemctl start nginx //启动Nginx服务
使用以下命令检查 Nginx 服务的状态:
> systemctl status nginx
打印出
4.防火墙开放端口
> firewall-cmd --permanent --zone=public --add-service=http
> firewall-cmd --permanent --zone=public --add-service=https
> firewall-cmd --reload
5.验证 Nginx,浏览器输入http://IP
Nginx的一些常用操作
停止 Nginx 服务 systemctl stop nginx
启动Nginx服务 systemctl start nginx
要重新启动Nginx的服务 systemctl restart nginx
进行一些配置更改后,重新加载 Nginx 服务systemctl reload nginx
Nginx 服务开机启动systemctl enable nginx
如果要禁用 Nginx 服务开机启动systemctl disable nginx
0条评论