centos 7 yum安装/卸载 最新稳定版nginx

安装nginx yum源

#rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装nginx

#yum -y install nginx

启动nginx

#systemctl start nginx.service

设置nginx开机自动启动

#systemctl enable nginx.service

防火墙允许80端口

#firewall-cmd --add-service=http

查看nginx版本
#nginx -v
输出如下:
nginx version: nginx/1.14.2
已安装上了最新稳定版的nginx。

测试

打开浏览器,输入http://服务器ip地址,出现以下页面即表示安装成功:
在这里插入图片描述

卸载nginx

卸载nginx命令:
#yum -y remove nginx

发布了19 篇原创文章 · 获赞 0 · 访问量 1442

猜你喜欢

转载自blog.csdn.net/qq_22356995/article/details/104157367