Asp.Net Core 快速入门-在Centos 上安装Nginx

第一步:添加CentOS 7EPEL 库

 在终端运行一下命令

sudo yum install epel-release

 第二步:安装Nginx

在终端运行命一下

sudo yum install nginx

你回答“yes”的提示后,nginx会完成安装到你的虚拟专用服务器(VPS)

第三步:启动Nginx

sudo systemctl start nginx

启动完成之后我们就可以用CentOS的IP和80端口访问Nginx了

如果无法访问,说明还是有问题

If you are running a firewall, run the following commands to allow HTTP and HTTPS traffic(如果您正在运行防火墙,请运行以下命令以允许HTTP和HTTPS通信)

扫描二维码关注公众号,回复: 6115049 查看本文章
sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

第四步:查看Nginx 是否安装成功

nginx -v

猜你喜欢

转载自www.cnblogs.com/hsj007/p/10808375.html