From 78f58a5141c604528e4a044b8a66ac63c9a59252 Mon Sep 17 00:00:00 2001 From: atiati123 Date: Wed, 24 Jan 2024 09:27:03 +0800 Subject: [PATCH] Update ch05-webpage.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在安装Nginx后,增加了开启Debian系统上默认的防火墙组件Uncomplicated Firewall (UFW),以便启用 HTTP (80) 和 HTTPS (443) 端口流量的步骤。 --- docs/document/level-0/ch05-webpage.md | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/document/level-0/ch05-webpage.md b/docs/document/level-0/ch05-webpage.md index 5f9223a..688b728 100644 --- a/docs/document/level-0/ch05-webpage.md +++ b/docs/document/level-0/ch05-webpage.md @@ -28,6 +28,36 @@ ![Nginx默认界面](./ch05-img01-nginx-default-running.png) +3. 如果无法看到上述Nginx默认页面,可能是需要配置Debian系统上默认的防火墙组件Uncomplicated Firewall (UFW),以便启用 HTTP (80) 和 HTTPS (443) 端口流量。 + + a. 验证方法,输入: + ```shell + sudo ufw status + ``` + b. 如果输出如下,表明80和433端口未开启,需要执行c步骤 + ```shell + Status: active + To Action From + -- ------ ---- + 22/tcp ALLOW Anywhere + 22/tcp (v6) ALLOW Anywhere (v6) + ``` + c. 启用UFW的Nginx 80 和 443 端口命令 + ```shell + sudo ufw allow 'Nginx Full' + ``` + d. 输入a中命令再次验证,如果输出如下,表示Nginx流量已经被防火墙放行,这样就应该可以看到前述第2点中的Nginx默认页面。 + ```shell + Status: active + To Action From + -- ------ ---- + 22/tcp ALLOW Anywhere + Nginx Full ALLOW Anywhere + 22/tcp (v6) ALLOW Anywhere (v6) + Nginx Full (v6) ALLOW Anywhere (v6) + ``` + + ## 5.3 创建一个最简单的网页 1. 小小白白 Linux 基础命令: