Nginx 是一个高性能的 web 服务软件. 相比 Apache HTTP Server 更加的轻量级和灵活, 是在 WEB 及服务端开发中必不可少的工具.
本文我们将介绍 CentOS 7 下 Nginx 的安装.
添加仓库
sudo yum install epel-release
安装 Nginx
sudo yum install nginx
启动 Nginx
sudo systemctl start nginx
如果系统使用了防火墙 (firewall), 执行下面命令允许 http/https
- sudo firewall-cmd --permanent --zone=public --add-service=http
- sudo firewall-cmd --permanent --zone=public --add-service=https
- sudo firewall-cmd --reload
来源: http://www.bubuko.com/infodetail-2766662.html