CentOS 安装nginx服务

安装nginx服务

sudo yum install nginx

 启动nginx

systemctl start nginx

 

 加入启动项

systemctl enable nginx 

 测试nginx服务

sudo curl http://localhost

 

 配置防火墙

firewall-cmd --zone=public --add-port=80/tcp --permanent 

 

 重启防火墙生效

systemctl restart firewalld  

 

使用ip外部访问 

 

 

  

  

 

  

 

 

  

posted @ 2019-12-20 15:42  sword88  阅读(366)  评论(0编辑  收藏  举报