# Linux 架設 Nginx Server ###### tags: `Linux`、`Nginx` 我們要來實作如何用 Linux 架設 Nginx Server #### 1. 下載 nginx ``` sudo apt-get install nginx ``` #### 2. 查看安裝是否成功 ``` nginx -v ``` 有看到下圖就是安裝成功 ![](https://hackmd.io/_uploads/SJDg_vWDn.png) #### 3. 開啟防火牆設定 Nginx 預設會在 80 Port,所以如果有開啟防火牆的朋友要打開 80 Port,不然會無法連線,443 Port 是 https 的預設 Port,也要打開 ``` ufw allow 80 ufw allow 443 ``` #### 4. 查看允許的 Port 確認 80 Port 是否有在 列表內 ``` ufw status verbose ``` ![](https://hackmd.io/_uploads/H1tx9wZP2.png) #### 5. 連線到網頁 Nginx Server 架設成功 ![](https://hackmd.io/_uploads/H1TX3P-Dn.png)