首页 > 技术文章 >  Centos7 安装Nginx的步骤

Centos7 安装Nginx的步骤

1.添加Nginx源:

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

2.安装Nginx

yum install -y nginx

3.启动Nginx并设置开机自启

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

4.关闭防火墙

systemctl stop firewalld.service

5.验证结果

在浏览器中输入您的服务器IP地址:http://IP地址

此答案有用么?
LiveZilla Live Chat Software