Linux RHEL7(CentOS7源) 安装 Nginx
安装步骤
1.添加 Nginx 源地址
CentOS7 默认没有提供 Nginx 的源,但 Nginx 自己提供了
1 sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2.安装 Nginx
1 yum install -y nginx #如果不用root用户登录,开头要加sudo
3.启动 Nginx
1 systemctl start nginx.service
2 systemctl enable nginx.service
4.关闭防火墙
1 #nginx
2 systemctl stop firewalld //关闭防火墙
3 systemctl disable firewalld //禁止开机启动
5.尝试登录
输入ip就可以看到nginx界面,nginx默认端口是80