1. 程式人生 > >CentOS 7 - 安裝Nginx

CentOS 7 - 安裝Nginx

https 輕量 -c 命令 執行 eas -s zone systemctl

Nginx是一個高性能的Web服務軟件。相比Apache HTTP Server更加的輕量級和靈活,是在WEB及服務端開發中必不可少的工具。

本文我們將介紹CentOS 7下Nginx的安裝。

  1. 添加倉庫
sudo yum install epel-release
  1. 安裝Nginx
sudo yum install nginx
  1. 啟動Nginx
sudo systemctl start nginx
  1. 如果系統使用了防火墻(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

CentOS 7 - 安裝Nginx