<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>无聊的博客</title>
        <link>https://blog.tianjiaji.top//</link>
        <description>一个无聊透顶的博客</description>
        <lastBuildDate>Wed, 05 Aug 2026 17:03:01 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, 神秘人</copyright>
        <item>
            <title><![CDATA[什么年代了！我不允许你还不会安装 Docker]]></title>
            <link>https://blog.tianjiaji.top//url/292183c0-6139-806c-a832-cbd3bddfe6c6</link>
            <guid>https://blog.tianjiaji.top//url/292183c0-6139-806c-a832-cbd3bddfe6c6</guid>
            <pubDate>Tue, 21 Oct 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[JDK + Hello World，搞定！]]></title>
            <link>https://blog.tianjiaji.top//url/282183c0-6139-80e5-9593-deb4d05fa9bb</link>
            <guid>https://blog.tianjiaji.top//url/282183c0-6139-80e5-9593-deb4d05fa9bb</guid>
            <pubDate>Sat, 04 Oct 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[掌握 Python 列表推导式]]></title>
            <link>https://blog.tianjiaji.top//url/250183c0-6139-800a-8eab-cef2ac5aa960</link>
            <guid>https://blog.tianjiaji.top//url/250183c0-6139-800a-8eab-cef2ac5aa960</guid>
            <pubDate>Fri, 15 Aug 2025 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-250183c06139800a8eabcef2ac5aa960"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-250183c0613980d291a4effc1622d32a" data-id="250183c0613980d291a4effc1622d32a"><span><div id="250183c0613980d291a4effc1622d32a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c0613980d291a4effc1622d32a" title="掌握Python列表推导式：从零开始，写出简洁高效的代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">掌握Python列表推导式：<b>从零开始，写出简洁高效的代码</b></span></span></h3><div class="notion-blank notion-block-250183c061398037a7a9f6c81cf2b420"> </div><div class="notion-callout notion-gray_background_co notion-block-250183c0613980f3be6bedcf6e8efd2a"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">你是否曾为写一堆冗长的<code class="notion-inline-code">for</code>循环而头疼？在Python中，列表推导式（List Comprehension）就像一把瑞士军刀——简洁、高效，还能让代码优雅如诗。但别担心，它并不神秘！今天，我将<b>循序渐进</b>地带你从零学会列表推导式。无论你是Python新手，还是想提升代码质量的老手，这篇文章都会用最直观的方式，让你在30分钟内熟练掌握这项核心技能。</div></div><blockquote class="notion-quote notion-block-250183c06139805e8f52e8b82af387b1"><div>为什么值得学？</div><div class="notion-text notion-block-250183c06139809d82fce02c9adfa79c">列表推导式能将5行循环代码压缩成1行，提升可读性（当合理使用时），并显著加速列表操作。它是Python“Pythonic”哲学的完美体现——用简单语法解决复杂问题。</div></blockquote><hr class="notion-hr notion-block-250183c061398075a40ac88e59b9aeeb"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c0613980f49445f5eb63192a5c" data-id="250183c0613980f49445f5eb63192a5c"><span><div id="250183c0613980f49445f5eb63192a5c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c0613980f49445f5eb63192a5c" title="第一步：理解基础——什么是列表推导式？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第一步：理解基础——什么是列表推导式？</span></span></h4><div class="notion-text notion-block-250183c061398021aceef609c17ab389">列表推导式是一种<b>用单行代码创建新列表</b>的语法。它基于现有可迭代对象（如列表、范围等），通过简洁的表达式生成新数据。核心思想是：<b>“描述你想要什么，而不是如何得到它”</b>。</div><div class="notion-text notion-block-250183c0613980588352cd5920ddf760"><b>基础语法</b>：</div><div class="notion-text notion-block-250183c061398025a989df5ff01b60e8"><b>举个栗子🌰：生成0-9的平方数列表</b></div><div class="notion-text notion-block-250183c0613980b09954efcd3ab0aafe">传统<code class="notion-inline-code">for</code>循环写法：</div><div class="notion-text notion-block-250183c0613980ada2cdc65abc9cfa93">用列表推导式：</div><div class="notion-text notion-block-250183c061398028b9cce12d8241ba2d"><b>输出</b>：<code class="notion-inline-code">[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]</code></div><div class="notion-text notion-block-250183c061398067bcaad927c6c64c48">✅ <b>关键点</b>：</div><ul class="notion-list notion-list-disc notion-block-250183c0613980eba131f09582dd23cd"><li><code class="notion-inline-code">x ** 2</code> 是<b>表达式</b>（对每个元素的操作）</li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980e5a9a0c383ffb87b84"><li><code class="notion-inline-code">for x in range(10)</code> 是<b>循环部分</b>（遍历数据源）</li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980a28976e48e503d4232"><li>整个结构用<code class="notion-inline-code">[]</code>包裹，直接生成新列表</li></ul><blockquote class="notion-quote notion-block-250183c0613980f4b881fd2eb29b41f0"><div>动手试试：打开Python解释器，输入 [x * 2 for x in range(5)]。猜猜输出是什么？（答案：[0, 2, 4, 6, 8]）</div></blockquote><hr class="notion-hr notion-block-250183c061398059b752ca9343208aa9"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c061398042ad94d1ae3ffa70d1" data-id="250183c061398042ad94d1ae3ffa70d1"><span><div id="250183c061398042ad94d1ae3ffa70d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c061398042ad94d1ae3ffa70d1" title="第二步：进阶技巧——添加条件过滤"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第二步：进阶技巧——添加条件过滤</span></span></h4><div class="notion-text notion-block-250183c0613980aeb87cdb6bdbc4b048">列表推导式不仅能生成数据，还能<b>用</b><code class="notion-inline-code"><b>if</b></code><b>条件筛选元素</b>。这就像给你的列表加了个“过滤器”。</div><div class="notion-text notion-block-250183c0613980459a72d56aafcffe14"><b>语法扩展</b>：</div><div class="notion-text notion-block-250183c06139800c95a0f7225803baa5"><b>栗子🌰：只保留偶数的平方</b></div><div class="notion-text notion-block-250183c061398043a76afddde0f3f890"><b>输出</b>：<code class="notion-inline-code">[0, 4, 16, 36, 64]</code></div><div class="notion-text notion-block-250183c06139802aa2a2fe86cbc5f4db">（解释：<code class="notion-inline-code">x % 2 == 0</code> 只保留偶数，再计算平方）</div><div class="notion-text notion-block-250183c0613980f4bb02df0bbc642867">✅ <b>关键点</b>：</div><ul class="notion-list notion-list-disc notion-block-250183c061398093b16ecd9e24e3278b"><li><code class="notion-inline-code">if</code> 条件<b>必须放在循环之后</b></li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980c880acc84e188c03fc"><li>条件是<b>布尔表达式</b>（返回True/False）</li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980e7b324c0a27fbd3217"><li>等效于在循环中加<code class="notion-inline-code">if</code>判断：</li><ul class="notion-list notion-list-disc notion-block-250183c0613980e7b324c0a27fbd3217"></ul></ul><blockquote class="notion-quote notion-block-250183c0613980cf8d99d0019fe86373"><div>挑战：写一个列表推导式，生成1-20中能被3整除的数的立方。</div><div class="notion-text notion-block-250183c0613980b19c1bf6d2cc966b4d">（提示：<code class="notion-inline-code">[x**3 for x in range(1,21) if x % 3 == 0]</code>）</div></blockquote><hr class="notion-hr notion-block-250183c06139806fa275ce13a2ee4371"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c0613980098085f48c9c658211" data-id="250183c0613980098085f48c9c658211"><span><div id="250183c0613980098085f48c9c658211" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c0613980098085f48c9c658211" title="第三步：实战应用——处理真实数据"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第三步：实战应用——处理真实数据</span></span></h4><div class="notion-text notion-block-250183c06139804a841fef413d25f364">现在，用实际场景巩固理解。假设你有一组用户数据：</div><div class="notion-text notion-block-250183c061398041a75dc9e587510443"><b>任务1：提取所有活跃用户的姓名</b></div><div class="notion-text notion-block-250183c0613980af9826f26f93f2329d"><b>输出</b>：<code class="notion-inline-code">[&#x27;Alice&#x27;, &#x27;Charlie&#x27;]</code></div><div class="notion-text notion-block-250183c06139800c883ce7965e3d1471"><b>任务2：生成带状态的欢迎消息</b></div><div class="notion-text notion-block-250183c061398026a603e32d172e2ef4"><b>输出</b>：<code class="notion-inline-code">[&#x27;Welcome Alice!&#x27;, &#x27;Welcome Bob!&#x27;]</code></div><div class="notion-text notion-block-250183c061398072a291d90d20f4deaf">✅ <b>关键点</b>：</div><ul class="notion-list notion-list-disc notion-block-250183c0613980fe8a8efcc606619b7b"><li>表达式可以是<b>任意Python表达式</b>（如字符串格式化、函数调用）</li></ul><ul class="notion-list notion-list-disc notion-block-250183c06139804db61be5d3a15966bc"><li>条件能基于<b>对象属性</b>动态过滤</li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980258871d9f7dac59e57"><li>代码一目了然：<em>“为每个用户，如果年龄&gt;20，生成欢迎消息”</em></li></ul><hr class="notion-hr notion-block-250183c061398059ac33d71ed77dd491"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c0613980979c39da203512c194" data-id="250183c0613980979c39da203512c194"><span><div id="250183c0613980979c39da203512c194" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c0613980979c39da203512c194" title="第四步：高级技巧——嵌套列表推导式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第四步：高级技巧——嵌套列表推导式</span></span></h4><div class="notion-text notion-block-250183c061398071bbe4c81a8174ed6f">当处理多维数据（如矩阵）时，嵌套推导式能大显身手。但<b>注意：保持可读性是关键！</b></div><div class="notion-text notion-block-250183c0613980979c5af8715ddfa638"><b>语法</b>：</div><div class="notion-text notion-block-250183c0613980a492aeeb3d9bca36d2"><b>栗子🌰：展平二维矩阵</b></div><div class="notion-text notion-block-250183c06139803d832ddb2e99cb931d"><b>输出</b>：<code class="notion-inline-code">[1, 2, 3, 4, 5, 6, 7, 8, 9]</code></div><div class="notion-text notion-block-250183c06139804881c7e8e12b35cb3a">✅ <b>关键点</b>：</div><ul class="notion-list notion-list-disc notion-block-250183c0613980c68b6cc3c8ef70542c"><li>嵌套顺序<b>从左到右</b>：先遍历<code class="notion-inline-code">row</code>，再遍历<code class="notion-inline-code">num</code></li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980c594b3ebd0f4b383bd"><li>等效于双层循环：</li><ul class="notion-list notion-list-disc notion-block-250183c0613980c594b3ebd0f4b383bd"></ul></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980e6a90becdbcc41f892"><li><b>避免过度嵌套</b>：超过2层时，用普通循环更清晰</li></ul><blockquote class="notion-quote notion-block-250183c061398073b35ece0a53a7568c"><div>警告：以下写法是错误的！</div><div class="notion-text notion-block-250183c06139809bb2f2e824566d5ba1"><code class="notion-inline-code">[num for num in row for row in matrix]</code> → 顺序错误，<code class="notion-inline-code">row</code>未定义</div></blockquote><hr class="notion-hr notion-block-250183c061398086ac99c09dde8297d9"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c061398097b9afd2c6dd7faafa" data-id="250183c061398097b9afd2c6dd7faafa"><span><div id="250183c061398097b9afd2c6dd7faafa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c061398097b9afd2c6dd7faafa" title="何时用列表推导式？何时不用？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">何时用列表推导式？何时不用？</span></span></h4><table class="notion-simple-table notion-block-250183c06139800ebd93eca3ea2f5173"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-250183c0613980efa500fce9b53f06d7"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">推荐方式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">原因</div></td></tr><tr class="notion-simple-table-row notion-block-250183c06139809d9ad6d41542eeb732"><td class="" style="width:120px"><div class="notion-simple-table-cell">简单转换/过滤</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">✅ 列表推导式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">代码简洁，意图明确</div></td></tr><tr class="notion-simple-table-row notion-block-250183c0613980f282c8e7fa73d22906"><td class="" style="width:120px"><div class="notion-simple-table-cell">复杂逻辑（多if/else）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">❌ 普通for循环</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可读性下降，易出错</div></td></tr><tr class="notion-simple-table-row notion-block-250183c06139808c8524ec1dea02fb82"><td class="" style="width:120px"><div class="notion-simple-table-cell">生成大列表</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">✅ 列表推导式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">速度比循环快10-30%</div></td></tr><tr class="notion-simple-table-row notion-block-250183c0613980a5b88ef749bab1f22d"><td class="" style="width:120px"><div class="notion-simple-table-cell">需要中间变量</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">❌ 普通for循环</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">推导式难调试</div></td></tr></tbody></table><div class="notion-text notion-block-250183c0613980c583fbc4e1ce515a57"><b>黄金法则</b>：</div><blockquote class="notion-quote notion-block-250183c06139804bb00de4723dc6468b"><div>“如果一行推导式超过80字符，或需要注释解释，就换回for循环。”</div></blockquote><hr class="notion-hr notion-block-250183c061398001bf84f8f48e550700"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c06139807caceefc32ddd81b25" data-id="250183c06139807caceefc32ddd81b25"><span><div id="250183c06139807caceefc32ddd81b25" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c06139807caceefc32ddd81b25" title="常见错误与避坑指南"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">常见错误与避坑指南</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-250183c06139808b9667ef469e9408b4" style="list-style-type:decimal"><li><b>忘记括号</b>：<code class="notion-inline-code">[x*2 for x in range(5)</code> → 缺少<code class="notion-inline-code">]</code>，语法错误</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-250183c0613980799705c96c0fc125ba" style="list-style-type:decimal"><li><b>混淆if位置</b>：<code class="notion-inline-code">[x for x in range(10) if x&gt;5 else x*2]</code> → 语法错误！
（正确写法：<code class="notion-inline-code">[x if x&gt;5 else x*2 for x in range(10)]</code>）</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-250183c0613980cca235d9ae0715b584" style="list-style-type:decimal"><li><b>过度嵌套</b>：3层以上的推导式像天书，拆分成循环更友好</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-250183c0613980be9873ed5a28035532" style="list-style-type:decimal"><li><b>误用于副作用</b>：推导式<b>不应包含print()等副作用操作</b>（用for循环）</li></ol><hr class="notion-hr notion-block-250183c06139802e9993ea6726f0a232"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-250183c0613980ce979bff831c3afbe1" data-id="250183c0613980ce979bff831c3afbe1"><span><div id="250183c0613980ce979bff831c3afbe1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#250183c0613980ce979bff831c3afbe1" title="结语：让列表推导式成为你的日常工具"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">结语：让列表推导式成为你的日常工具</span></span></h4><div class="notion-text notion-block-250183c0613980bca5b9ec9df9c8c89c">列表推导式不是炫技，而是<b>提升代码效率的实用技能</b>。从今天起：</div><ol start="1" class="notion-list notion-list-numbered notion-block-250183c06139802ba641e5c861b008de" style="list-style-type:decimal"><li>遇到简单列表生成时，先想想能否用推导式</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-250183c061398013a7f3d3aabf05278e" style="list-style-type:decimal"><li>从基础语法开始练习，逐步尝试条件过滤</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-250183c0613980f8b1c4ed170b242cd6" style="list-style-type:decimal"><li>始终记住：<b>可读性 &gt; 简洁性</b></li></ol><blockquote class="notion-quote notion-block-250183c0613980a39f39fe43dc185748"><div>“Python之禅说：‘优美胜于丑陋’。列表推导式正是这一哲学的化身——用优雅的语法，让代码呼吸。”</div></blockquote><div class="notion-text notion-block-250183c061398094ad08c4a39f879ffd"><b>立即行动</b>：</div><div class="notion-text notion-block-250183c06139800a8494e7cf7ae2d16e">打开你的编辑器，试着用列表推导式解决这些问题：</div><ol start="1" class="notion-list notion-list-numbered notion-block-250183c0613980e4a5b6ed922272a7b4" style="list-style-type:decimal"><li>生成100以内所有3的倍数</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-250183c0613980e08543e43a2739fdb9" style="list-style-type:decimal"><li>从字符串列表 <code class="notion-inline-code">[&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]</code> 中提取首字母</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-250183c061398053b7a7ef4cb8b3ae05" style="list-style-type:decimal"><li>将字典 <code class="notion-inline-code">{&quot;a&quot;:1, &quot;b&quot;:2}</code> 转换为 <code class="notion-inline-code">[(&quot;a&quot;,1), (&quot;b&quot;,2)]</code></li></ol><div class="notion-text notion-block-250183c0613980488530dd480dfb6bfd">在评论区分享你的答案，我会亲自点评！如果觉得有帮助，转发给需要的朋友——让Python编程更轻松愉快。</div><div class="notion-text notion-block-250183c0613980f2bb93d1b7a06aa3b8"><b>延伸学习</b>：</div><ul class="notion-list notion-list-disc notion-block-250183c06139801fa312d22f81a5dfe0"><li>生成器推导式（用<code class="notion-inline-code">()</code>代替<code class="notion-inline-code">[]</code>，节省内存）</li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980c3baede1c7fb81ce33"><li>字典推导式：<code class="notion-inline-code">{k: v for k, v in items}</code></li></ul><ul class="notion-list notion-list-disc notion-block-250183c0613980969c33e43e2d00e108"><li>集合推导式：<code class="notion-inline-code">{x for x in data}</code></li></ul><div class="notion-text notion-block-250183c061398061ae57c880f3130bed"><b>Happy Coding!</b> 🐍</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[使用GitHub Pages发布静态网页]]></title>
            <link>https://blog.tianjiaji.top//url/github-001</link>
            <guid>https://blog.tianjiaji.top//url/github-001</guid>
            <pubDate>Mon, 11 Nov 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-142183c061398069898bdff49c2a9460"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-142183c06139816e8a3aeeca2baf1f6f" data-id="142183c06139816e8a3aeeca2baf1f6f"><span><div id="142183c06139816e8a3aeeca2baf1f6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139816e8a3aeeca2baf1f6f" title="使用GitHub Pages发布静态网页"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">使用GitHub Pages发布静态网页</span></span></h2><hr class="notion-hr notion-block-142183c0613981458ff0c7461daa8743"/><div class="notion-blank notion-block-142183c0613981e2b863e14b726e4a47"> </div><div class="notion-callout notion-gray_background_co notion-block-142183c0613981cf8061f756d41dee96"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"> 文字版教程</div></div><div class="notion-blank notion-block-142183c0613981298365cc851394ed86"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c061398157bc2ff362f4538744" data-id="142183c061398157bc2ff362f4538744"><span><div id="142183c061398157bc2ff362f4538744" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c061398157bc2ff362f4538744" title="步骤 1: 创建 GitHub 账户（如果还没有的话）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 1: 创建 GitHub 账户（如果还没有的话）</b></span></span></h4><div class="notion-text notion-block-142183c0613981bea6c9cbbb450d86dd">如果你还没有 GitHub 账户，请访问 <a class="notion-link" href="https://github.com/" target="_blank" rel="noopener noreferrer">GitHub 官网</a> ：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c061398116819fe7455d63300c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:293px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F6fad972c-2070-449d-b5b7-a227ebd3bbbc%2Fimage.png?table=block&amp;id=142183c0-6139-8116-819f-e7455d63300c&amp;t=142183c0-6139-8116-819f-e7455d63300c&amp;width=293&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-142183c0613981e8b232f063cbc492a2">并注册一个新账户，点击“Sign up”即可注册。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c06139814fb83fe35302ea8516"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:325px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2Fdfb6c60f-7a1a-4cde-8460-32566dba1401%2Fimage.png?table=block&amp;id=142183c0-6139-814f-b83f-e35302ea8516&amp;t=142183c0-6139-814f-b83f-e35302ea8516&amp;width=325&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-142183c0613981fa84eae7ff64c18550">注册过程很简单，只需按照网站上的指示操作即可。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c0613981d388e1fa819d75f38d" data-id="142183c0613981d388e1fa819d75f38d"><span><div id="142183c0613981d388e1fa819d75f38d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981d388e1fa819d75f38d" title="步骤 2: 创建新的 GitHub 仓库"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 2: 创建新的 GitHub 仓库</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-142183c06139817680cbc31de683b545" style="list-style-type:decimal"><li>登录你的 GitHub 账户。</li><ol class="notion-list notion-list-numbered notion-block-142183c06139817680cbc31de683b545" style="list-style-type:lower-alpha"><li>点击“Sign in”按钮</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981549654ed236738b542" style="list-style-type:lower-roman"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c06139810babeac9fd6086cb0a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:302.96875px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F7578a098-78ae-46e7-b27a-0c5fd50749a7%2Fimage.png?table=block&amp;id=142183c0-6139-810b-abea-c9fd6086cb0a&amp;t=142183c0-6139-810b-abea-c9fd6086cb0a&amp;width=302.96875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol><li>输入账号密码进行登录</li><ol class="notion-list notion-list-numbered notion-block-142183c061398127b6b5e76ba4ac065d" style="list-style-type:lower-roman"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c06139813e8eacc1120be07c4a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:302.9895935058594px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2Fc520967f-e344-4e1b-ac1a-530fd5cfe377%2Fimage.png?table=block&amp;id=142183c0-6139-813e-8eac-c1120be07c4a&amp;t=142183c0-6139-813e-8eac-c1120be07c4a&amp;width=302.9895935058594&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-142183c0613981778372f7b7303a0611" style="list-style-type:decimal"><li>在右上角，点击加号图标（+），选择 &quot;New repository&quot;。</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981778372f7b7303a0611" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c06139818fab0ed8302a8fda15"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:304px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F23619175-79ce-421d-844a-0c3263e6dc8c%2Fimage.png?table=block&amp;id=142183c0-6139-818f-ab0e-d8302a8fda15&amp;t=142183c0-6139-818f-ab0e-d8302a8fda15&amp;width=304&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-142183c061398193ae4ec714b6a6574f" style="list-style-type:decimal"><li>在 &quot;Repository name&quot; 中输入你的项目名称，例如 <code class="notion-inline-code">my-website</code>。</li><ol class="notion-list notion-list-numbered notion-block-142183c061398193ae4ec714b6a6574f" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c0613981bfb0c9ec7b5b323284"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F6b234d84-e9fd-47bd-b0e5-7b2f8b0357e0%2Fimage.png?table=block&amp;id=142183c0-6139-81bf-b0c9-ec7b5b323284&amp;t=142183c0-6139-81bf-b0c9-ec7b5b323284&amp;width=718.9375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="4" class="notion-list notion-list-numbered notion-block-142183c0613981ff9213e2e59950a3d7" style="list-style-type:decimal"><li>可以选择使仓库公开或私有。对于公开的仓库，任何人都可以看到你的代码；私有仓库则只有你和你邀请的人可以查看。</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981ff9213e2e59950a3d7" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c0613981fe8743d3b0ce977446"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:330.97918701171875px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F4d7f0058-80ca-4486-af11-4085280950b9%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE_2024-11-12_001426.png?table=block&amp;id=142183c0-6139-81fe-8743-d3b0ce977446&amp;t=142183c0-6139-81fe-8743-d3b0ce977446&amp;width=330.97918701171875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="5" class="notion-list notion-list-numbered notion-block-142183c0613981fd8807e034158a30e3" style="list-style-type:decimal"><li>勾选 &quot;Initialize this repository with a README&quot;，这将自动为你的仓库添加一个 <code class="notion-inline-code">README.md</code> 文件。</li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-142183c06139816ba2dbcf805dab4c55" style="list-style-type:decimal"><li>点击 &quot;Create repository&quot; 按钮完成创建。</li><ol class="notion-list notion-list-numbered notion-block-142183c06139816ba2dbcf805dab4c55" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-142183c0613981218001c797d1733eec"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:192px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a%2F17562139-b367-4749-976b-7b605f53bebf%2Fimage.png?table=block&amp;id=142183c0-6139-8121-8001-c797d1733eec&amp;t=142183c0-6139-8121-8001-c797d1733eec&amp;width=192&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c0613981a3ae47fb27954e6e96" data-id="142183c0613981a3ae47fb27954e6e96"><span><div id="142183c0613981a3ae47fb27954e6e96" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981a3ae47fb27954e6e96" title="步骤 3: 准备你的网页文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 3: 准备你的网页文件</b></span></span></h4><div class="notion-text notion-block-142183c06139819283a5e738fc7eed71">在本地计算机上准备你的网页文件，包括但不限于：</div><ul class="notion-list notion-list-disc notion-block-142183c0613981c690eef2d81dfd4d2b"><li><code class="notion-inline-code">index.html</code>：主页文件。</li></ul><ul class="notion-list notion-list-disc notion-block-142183c0613981b9925de90e22e30b77"><li><code class="notion-inline-code">style.css</code>：样式表文件。</li></ul><ul class="notion-list notion-list-disc notion-block-142183c0613981bfbd52e75b7708d924"><li><code class="notion-inline-code">script.js</code>：JavaScript 文件。</li></ul><ul class="notion-list notion-list-disc notion-block-142183c06139810dbe78f375e3fcbfa4"><li>图片和其他资源文件。</li></ul><div class="notion-text notion-block-142183c061398102affddfdbb0cd0fe8">确保所有文件都组织得当，比如将图片放在 <code class="notion-inline-code">images</code> 文件夹中，脚本文件放在 <code class="notion-inline-code">scripts</code> 文件夹中等，并打包。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c0613981ba8b08eea3647a827a" data-id="142183c0613981ba8b08eea3647a827a"><span><div id="142183c0613981ba8b08eea3647a827a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981ba8b08eea3647a827a" title="步骤 4: 将文件上传到 GitHub 仓库"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 4: 将文件上传到 GitHub 仓库</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-142183c0613981a684cdfb3c5a7fb150" style="list-style-type:decimal"><li>进入你刚刚创建的 GitHub 仓库页面。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-142183c0613981fd90bed31219f5afb2" style="list-style-type:decimal"><li>点击 &quot;Add file&quot; &gt; &quot;Upload files&quot;。</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981fd90bed31219f5afb2" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c061398010a1bfec5e519bcd68"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVozqSI.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-8010-a1bf-ec5e519bcd68" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-142183c0613981228a35dbd9b3ca3718" style="list-style-type:decimal"><li>你可以拖放文件到浏览器窗口，或者点击 &quot;Choose your files&quot; 来选择要上传的文件。</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981228a35dbd9b3ca3718" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980ba9fccc8e99831b3cf"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:336px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVozHfA.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-80ba-9fcc-c8e99831b3cf" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="4" class="notion-list notion-list-numbered notion-block-142183c061398193b882c41eb8d163cb" style="list-style-type:decimal"><li>选择完文件后，向下滚动并填写提交信息，如 &quot;Add website files&quot;。</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-142183c06139819e87b1dab11a537459" style="list-style-type:decimal"><li>点击 &quot;Commit changes&quot; 完成上传。</li><ol class="notion-list notion-list-numbered notion-block-142183c06139819e87b1dab11a537459" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980439da4e762472c5c77"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVoz7Yd.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-8043-9da4-e762472c5c77" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c06139813b89fdf86d416bc1a8" data-id="142183c06139813b89fdf86d416bc1a8"><span><div id="142183c06139813b89fdf86d416bc1a8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139813b89fdf86d416bc1a8" title="步骤 5: 启用 GitHub Pages"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 5: 启用 GitHub Pages</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-142183c06139819ebbb7d8ffcbe962d2" style="list-style-type:decimal"><li>在你的仓库页面，点击 &quot;Settings（设置）&quot; 选项卡。</li><ol class="notion-list notion-list-numbered notion-block-142183c06139819ebbb7d8ffcbe962d2" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980b3be15d96240666927"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVozfOK.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-80b3-be15-d96240666927" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-142183c0613981b5a81ce245a2508e13" style="list-style-type:decimal"><li>向下滚动到 &quot;Pages&quot; 部分。</li><ol class="notion-list notion-list-numbered notion-block-142183c0613981b5a81ce245a2508e13" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980838db3c82902942518"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVoz4eO.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-8083-8db3-c82902942518" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-142183c0613981ccbef6e5a3ead68243" style="list-style-type:decimal"><li>在 &quot;Source&quot; 下拉菜单中，选择 <code class="notion-inline-code">main</code> 分支作为源分支。如果你使用的是其他分支，可以选择相应的分支。</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-142183c061398159a9fbf52c169e53fc" style="list-style-type:decimal"><li>点击 &quot;Save&quot; 按钮保存设置。GitHub 将会处理你的请求，并在几秒钟到几分钟内生成你的网站。</li><ol class="notion-list notion-list-numbered notion-block-142183c061398159a9fbf52c169e53fc" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980768cddec6d8c0dbee5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVozITe.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-8076-8cdd-ec6d8c0dbee5" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="5" class="notion-list notion-list-numbered notion-block-142183c061398199ab5cfd7e142544e6" style="list-style-type:decimal"><li>一旦网站准备好，你会看到一个链接，指向你的新网站，格式通常是 <code class="notion-inline-code">https://&lt;username&gt;.github.io/&lt;repository-name&gt;/</code>。</li><ol class="notion-list notion-list-numbered notion-block-142183c061398199ab5cfd7e142544e6" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980319bdcf1c160a13f6f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVoz5wD.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-8031-9bdc-f1c160a13f6f" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><ol start="6" class="notion-list notion-list-numbered notion-block-142183c06139813f87cdda1314bd3d50" style="list-style-type:decimal"><li>恭喜你，成功发布你的第一个网站！！！</li><ol class="notion-list notion-list-numbered notion-block-142183c06139813f87cdda1314bd3d50" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-27e183c0613980c5bb56f02932020f17"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://s21.ax1x.com/2025/09/30/pVozTFH.png?spaceId=9217c6f5-29c5-4a9b-ac74-3a65b3d2c92a&amp;t=27e183c0-6139-80c5-bb56-f02932020f17" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol><div class="notion-blank notion-block-142183c06139814eb0c8c46f25c87920"> </div><div class="notion-text notion-block-142183c061398165adcdf4d2ec2844b9"><b>温馨提示：</b>每次你对仓库中的文件进行更改并推送这些更改后，GitHub Pages 会自动更新你的网站。</div><div class="notion-blank notion-block-142183c0613981eb9a10d8b170180617"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-142183c06139819cbf4dfadb05591be4" data-id="142183c06139819cbf4dfadb05591be4"><span><div id="142183c06139819cbf4dfadb05591be4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139819cbf4dfadb05591be4" title="步骤 6:警告"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>步骤 6:</b><span class="notion-red"><b>警告</b></span></span></span></h4><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c0613981a29b36f037396d275d" data-id="142183c0613981a29b36f037396d275d"><span><div id="142183c0613981a29b36f037396d275d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981a29b36f037396d275d" title="警告：请不要滥用公共服务，请不要发布违反当地法律和违反道德的信息，后果自负！！！"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><span class="notion-red"><b>警告：请不要滥用公共服务，请不要发布违反当地法律和违反道德的信息，后果自负！！！</b></span></span></span></h3><div class="notion-blank notion-block-27e183c0613980299276c6154768d988"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML 框架集与框架速查]]></title>
            <link>https://blog.tianjiaji.top//url/147183c0-6139-80da-8224-e6b8e15ffa26</link>
            <guid>https://blog.tianjiaji.top//url/147183c0-6139-80da-8224-e6b8e15ffa26</guid>
            <pubDate>Sat, 23 Nov 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-147183c0613980da8224e6b8e15ffa26"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-147183c06139815584fcee01f4b659c9" data-id="147183c06139815584fcee01f4b659c9"><span><div id="147183c06139815584fcee01f4b659c9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c06139815584fcee01f4b659c9" title="HTML 框架集与框架速查表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>HTML 框架集与框架速查表</b></span></span></h2><div class="notion-callout notion-gray_background_co notion-block-147183c0613981b58c7fe6e4cfe3311c"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><b>速查表</b></div></div><hr class="notion-hr notion-block-27e183c0613980f49727dd607f3c33c0"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980a682bfccbd7dc4a8f0" data-id="147183c0613980a682bfccbd7dc4a8f0"><span><div id="147183c0613980a682bfccbd7dc4a8f0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980a682bfccbd7dc4a8f0" title="&lt;frameset&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;frameset&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c0613980cca9c5da9ae9c48752"><li><b>定义</b>：定义一个框架集，用于将窗口分割成多个框架。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c0613980c1b61be9ba46c8654c"><li><b>属性</b>：</li><ul class="notion-list notion-list-disc notion-block-147183c0613980c1b61be9ba46c8654c"><table class="notion-simple-table notion-block-147183c061398083b0e8d7ba63b8f2ef"><tbody><tr class="notion-simple-table-row notion-block-147183c06139801e982ad9ad7954753a"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>属性</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>参数</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>描述</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>示例</b></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980c59220d2ea30ad9254"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">rows</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">逗号分隔的数值或百分比，如 <code class="notion-inline-code">100,*,200</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">定义框架集的行布局</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frameset rows=&quot;100,*,200&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c06139800cbed9d7088f369f16"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">cols</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">逗号分隔的数值或百分比，如 <code class="notion-inline-code">25%,*,50%</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">定义框架集的列布局</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frameset cols=&quot;25%,*,50%&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980ad8e22f156e5ef580f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">border</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">数值（像素），如 <code class="notion-inline-code">1</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置框架边框的宽度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frameset border=&quot;1&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980b5bcbac5b9e245c3a1"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">frameborder</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">0</code>（无边框）、<code class="notion-inline-code">1</code>（有边框）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置是否显示框架边框</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frameset frameborder=&quot;1&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c061398059987afa3ea0cda29f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">framespacing</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">数值（像素），如 <code class="notion-inline-code">2</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置框架之间的间距</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frameset framespacing=&quot;2&quot;&gt;</code></div></td></tr></tbody></table></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980aba68ed5c0c5fcbde4" data-id="147183c0613980aba68ed5c0c5fcbde4"><span><div id="147183c0613980aba68ed5c0c5fcbde4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980aba68ed5c0c5fcbde4" title="&lt;frame&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;frame&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c06139804580f8f023d1c0b8ec"><li><b>定义</b>：定义一个框架。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c0613980cc99d6fd807e4fadf6"><li><b>属性</b>：</li><ul class="notion-list notion-list-disc notion-block-147183c0613980cc99d6fd807e4fadf6"><table class="notion-simple-table notion-block-147183c061398062b309c098fd0c50e5"><tbody><tr class="notion-simple-table-row notion-block-147183c0613980a68bcdd7f4da9a6dc7"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>属性</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>参数</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>描述</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>示例</b></div></td></tr><tr class="notion-simple-table-row notion-block-147183c061398048a637ccf5500e8ff1"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">src</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">URL</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">指定框架加载的文档地址</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980c0a275d7e14ef18a1c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">name</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">字符串，如 <code class="notion-inline-code">frame1</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">为框架指定一个名称，用于目标引用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame name=&quot;frame1&quot; src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980939058e3964af3ed26"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">noresize</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">noresize</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">禁止调整框架大小</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame noresize src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c061398074a327e5febace5c17"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">scrolling</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">auto</code>（自动）、<code class="notion-inline-code">yes</code>（始终显示滚动条）、<code class="notion-inline-code">no</code>（不显示滚动条）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置框架的滚动条行为</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame scrolling=&quot;auto&quot; src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c061398019aa44d71cf2805c6f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">marginwidth</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">数值（像素），如 <code class="notion-inline-code">10</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置框架内容与左边和右边边框的距离</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame marginwidth=&quot;10&quot; src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c06139809da76bc30039f7d9f1"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">marginheight</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">数值（像素），如 <code class="notion-inline-code">10</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置框架内容与上边和下边边框的距离</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame marginheight=&quot;10&quot; src=&quot;page1.html&quot;&gt;</code></div></td></tr><tr class="notion-simple-table-row notion-block-147183c0613980c685cbd79413ef0827"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">frameborder</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">0</code>（无边框）、<code class="notion-inline-code">1</code>（有边框）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置是否显示框架边框</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;frame frameborder=&quot;1&quot; src=&quot;page1.html&quot;&gt;</code></div></td></tr></tbody></table></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c06139807eafecf74e130411ef" data-id="147183c06139807eafecf74e130411ef"><span><div id="147183c06139807eafecf74e130411ef" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c06139807eafecf74e130411ef" title="&lt;noframes&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;noframes&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c06139805a85f1c858371b0fc9"><li><b>定义</b>：定义不支持框架的浏览器中显示的内容。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139803e8abfcb3f242dfcca"><li><b>属性</b>：无</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c061398027a001edacaab206d0" data-id="147183c061398027a001edacaab206d0"><span><div id="147183c061398027a001edacaab206d0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c061398027a001edacaab206d0" title="示例代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>示例代码</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980c8bd6bd9eb591798ef" data-id="147183c0613980c8bd6bd9eb591798ef"><span><div id="147183c0613980c8bd6bd9eb591798ef" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980c8bd6bd9eb591798ef" title="框架集示例"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>框架集示例</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c06139807f9b72eac1c050fee1" data-id="147183c06139807f9b72eac1c050fee1"><span><div id="147183c06139807f9b72eac1c050fee1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c06139807f9b72eac1c050fee1" title="详细说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>详细说明</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980bba329f0e2fa039f56" data-id="147183c0613980bba329f0e2fa039f56"><span><div id="147183c0613980bba329f0e2fa039f56" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980bba329f0e2fa039f56" title="&lt;frameset&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;frameset&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c061398055a6b3d192c9618de8"><li><code class="notion-inline-code"><b>rows</b></code>：定义框架集的行布局。参数可以是数值或百分比，用逗号分隔。例如，<code class="notion-inline-code">100,*,200</code> 表示第一行高度为100像素，第二行高度为剩余空间，第三行高度为200像素。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139804682d4e91c877ada41"><li><code class="notion-inline-code"><b>cols</b></code>：定义框架集的列布局。参数可以是数值或百分比，用逗号分隔。例如，<code class="notion-inline-code">25%,*,50%</code> 表示第一列宽度为25%，第二列宽度为剩余空间，第三列宽度为50%。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139808eb131c194e69dd2e9"><li><code class="notion-inline-code"><b>border</b></code>：设置框架边框的宽度。参数为数值，单位为像素。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139808aace5fb3815177b03"><li><code class="notion-inline-code"><b>frameborder</b></code>：设置是否显示框架边框。参数为 <code class="notion-inline-code">0</code>（无边框）或 <code class="notion-inline-code">1</code>（有边框）。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139800285d1d8e8eeb268d1"><li><code class="notion-inline-code"><b>framespacing</b></code>：设置框架之间的间距。参数为数值，单位为像素。</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980feac4bfb84dd6b487d" data-id="147183c0613980feac4bfb84dd6b487d"><span><div id="147183c0613980feac4bfb84dd6b487d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980feac4bfb84dd6b487d" title="&lt;frame&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;frame&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c061398041b8e3fb875221a6e2"><li><code class="notion-inline-code"><b>src</b></code>：指定框架加载的文档地址。参数为URL。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139808d8a14d65d5c62f601"><li><code class="notion-inline-code"><b>name</b></code>：为框架指定一个名称，用于目标引用。参数为字符串。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c0613980c5b52ef1aa72f6db31"><li><code class="notion-inline-code"><b>noresize</b></code>：禁止调整框架大小。参数为 <code class="notion-inline-code">noresize</code>。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c06139809dbdb4d1d77361f5f9"><li><code class="notion-inline-code"><b>scrolling</b></code>：设置框架的滚动条行为。参数为 <code class="notion-inline-code">auto</code>（自动）、<code class="notion-inline-code">yes</code>（始终显示滚动条）、<code class="notion-inline-code">no</code>（不显示滚动条）。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c061398004a1f5c69794ce68ec"><li><code class="notion-inline-code"><b>marginwidth</b></code>：设置框架内容与左边和右边边框的距离。参数为数值，单位为像素。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c0613980edb7e4c051d378dbf5"><li><code class="notion-inline-code"><b>marginheight</b></code>：设置框架内容与上边和下边边框的距离。参数为数值，单位为像素。</li></ul><ul class="notion-list notion-list-disc notion-block-147183c0613980f398adcc9bc7bb8e5e"><li><code class="notion-inline-code"><b>frameborder</b></code>：设置是否显示框架边框。参数为 <code class="notion-inline-code">0</code>（无边框）或 <code class="notion-inline-code">1</code>（有边框）。</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-147183c0613980f6bbdcc0f1c35dfa11" data-id="147183c0613980f6bbdcc0f1c35dfa11"><span><div id="147183c0613980f6bbdcc0f1c35dfa11" class="notion-header-anchor"></div><a class="notion-hash-link" href="#147183c0613980f6bbdcc0f1c35dfa11" title="&lt;noframes&gt; 标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code"><b>&lt;noframes&gt;</b></code><b> 标签</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-147183c0613980fd85eff497bd7d730e"><li><b>定义</b>：定义不支持框架的浏览器中显示的内容。通常包含提示信息或替代内容。</li></ul><div class="notion-text notion-block-147183c0613980128700d9a0234d5b33">希望这个详细的速查表格对你有帮助！</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tomcat 服务]]></title>
            <link>https://blog.tianjiaji.top//url/142183c0-6139-80e3-a1c3-f44f4bf48396</link>
            <guid>https://blog.tianjiaji.top//url/142183c0-6139-80e3-a1c3-f44f4bf48396</guid>
            <pubDate>Tue, 26 Mar 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-142183c0613980e3a1c3f44f4bf48396"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><hr class="notion-hr notion-block-142183c06139811698d5d68f40077222"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-142183c06139817581f5f7294f227837" data-id="142183c06139817581f5f7294f227837"><span><div id="142183c06139817581f5f7294f227837" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139817581f5f7294f227837" title="Tomcat 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Tomcat 服务</span></span></h2><hr class="notion-hr notion-block-142183c0613981adbc0df8682d9487ef"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c06139812188d1fb15ec1c4084" data-id="142183c06139812188d1fb15ec1c4084"><span><div id="142183c06139812188d1fb15ec1c4084" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139812188d1fb15ec1c4084" title="题目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">题目</span></span></h3><div class="notion-text notion-block-142183c0613981d390aacf3c07324b89">3．tomcat 服务
任务描述：采用 Tomcat 搭建动态网站。</div><div class="notion-text notion-block-142183c06139811f972ff223731cac81">(1)配置 linux2 为 nginx 服务器，默认文档 index.html 的内容为 “hellonginx”；仅允许使用域名访问，http 访问自动跳转到 https。
(2)利用 nginx 反向代理，实现 linux3 和 linux4 的 tomcat 负载均衡，通过 https//tomcat.skills.lan 加密访问 Tomcat
(3)配置 linux3 和 linux4 为 tomcat 服务器，网站默认首页内容分别为 “tomcatA” 和 “tomcatB”，仅使用域名访问 80 端口的 http 服务。</div><hr class="notion-hr notion-block-142183c0613981ba918afc064ac40f3a"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c0613981bdb661cb1f35e7268d" data-id="142183c0613981bdb661cb1f35e7268d"><span><div id="142183c0613981bdb661cb1f35e7268d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981bdb661cb1f35e7268d" title="安装服务并开放防火墙"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装服务并开放防火墙</span></span></h3><hr class="notion-hr notion-block-142183c06139811b9e3ed4399b7ba3fc"/><div class="notion-text notion-block-142183c061398195831eff26d60c83cc">为 linux2 安装 Nginx</div><div class="notion-text notion-block-142183c0613981489b2afdbba5aeac37">为 linux3 安装 Tomcat</div><div class="notion-text notion-block-142183c061398120aadfd1cbe81facac">为 linux4 安装 Tomcat</div><div class="notion-text notion-block-142183c0613981b5b89dd34332a817ea">端口定义：
80      http服务
443     https服务
8080    一般也是http之类的服务</div><hr class="notion-hr notion-block-142183c0613981c4987afeadcb0dbf75"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c061398103ac81d50793750694" data-id="142183c061398103ac81d50793750694"><span><div id="142183c061398103ac81d50793750694" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c061398103ac81d50793750694" title="配置 Tomcat"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">配置 Tomcat</span></span></h3><hr class="notion-hr notion-block-142183c061398118ad7dffa12e998bcc"/><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-142183c06139814a96bad88e880041e6" data-id="142183c06139814a96bad88e880041e6"><span><div id="142183c06139814a96bad88e880041e6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139814a96bad88e880041e6" title="Linux 3 配置："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Linux 3 配置：</span></span></h4><div class="notion-text notion-block-142183c0613981498656d155228f416e">打开Tomcat配置文件：</div><div class="notion-text notion-block-142183c06139814b86b7e6231df03b45">大约：131行</div><div class="notion-text notion-block-142183c0613981858b53c1f6af0a9116">大约：151行</div><div class="notion-text notion-block-142183c06139813eba90df7fa6fdcdf9">设置开机自启，然后--now代表立即启动。</div><div class="notion-text notion-block-142183c0613981d2a764d4a8a5782b69">删除站点模板文件</div><div class="notion-text notion-block-142183c061398152a630c090f23285e7">创建index.html，并写入&quot;TomcatA&quot;</div><div class="notion-text notion-block-142183c0613981db9ab6e100d67c52a4">重启Tomcat服务</div><hr class="notion-hr notion-block-142183c0613981dd8b25e5944b03bdb5"/><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-142183c061398149a3ccedcf03535cd1" data-id="142183c061398149a3ccedcf03535cd1"><span><div id="142183c061398149a3ccedcf03535cd1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c061398149a3ccedcf03535cd1" title="Linux 4 配置："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Linux 4 配置：</span></span></h4><div class="notion-text notion-block-142183c0613981618686f055beb9584d">打开Tomcat配置文件：</div><div class="notion-text notion-block-142183c0613981508c4fd5bac6835bbc">大约：131行</div><div class="notion-text notion-block-142183c0613981789096c0819122660f">大约：151行</div><div class="notion-text notion-block-142183c061398138bfc9e86fd50260cc">设置开机自启，然后立即启动。</div><div class="notion-text notion-block-142183c06139814bafdaf1e7cf764cae">删除模板文件</div><div class="notion-text notion-block-142183c0613981668c64e4b3e4f5884f">创建index.html，并写入&quot;TomcatB&quot;</div><div class="notion-text notion-block-142183c0613981d09f5fc850311c2612">重启服务</div><hr class="notion-hr notion-block-142183c06139812bb308f8642e00f192"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c0613981689675cf321c67ee6f" data-id="142183c0613981689675cf321c67ee6f"><span><div id="142183c0613981689675cf321c67ee6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981689675cf321c67ee6f" title="测试 Tomcat"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">测试 Tomcat</span></span></h3><div class="notion-text notion-block-142183c0613981c4aa4de83bf5048109">使用 curl 命令 进行验证，如：</div><div class="notion-text notion-block-142183c061398182abe4f98b1930a020"><span class="notion-red"><b>提示：若无法连接请检查防火墙是否放行相应端口，以及测试时是否输入端口号！</b></span></div><hr class="notion-hr notion-block-142183c0613981d0a5d3ea088b547046"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c0613981a2850bc597fbdb7612" data-id="142183c0613981a2850bc597fbdb7612"><span><div id="142183c0613981a2850bc597fbdb7612" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981a2850bc597fbdb7612" title="更改端口"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更改端口</span></span></h3><div class="notion-text notion-block-142183c0613981b99e0ddd205e1bb253">因为该服务默认没有使用root用户所以在使用高位端口（0~1024）的时候没有权限，会导致服务没法正常启动。
改权限：
<span class="notion-red"><b>注意：两台 Tomcat 服务器都要改</b></span></div><div class="notion-text notion-block-142183c06139816bb383e0ee191f278a">修改端口</div><div class="notion-text notion-block-142183c0613981239c83ef762e70fe41">大约在第69行：</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c06139819fac95f4eca0c5ffd7" data-id="142183c06139819fac95f4eca0c5ffd7"><span><div id="142183c06139819fac95f4eca0c5ffd7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139819fac95f4eca0c5ffd7" title="测试 Tomcat"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">测试 Tomcat</span></span></h3><div class="notion-text notion-block-142183c06139816e892eeb9e453f662a">使用 curl 命令 进行验证，如：</div><hr class="notion-hr notion-block-142183c0613981eb8521c7c32f855205"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c061398111b62ff2a4cb17e914" data-id="142183c061398111b62ff2a4cb17e914"><span><div id="142183c061398111b62ff2a4cb17e914" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c061398111b62ff2a4cb17e914" title="配置 Nginx"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">配置 Nginx</span></span></h3><div class="notion-text notion-block-142183c0613981fa918fd7d9deb79f8f">打开 Nginx 配置文件</div><div class="notion-text notion-block-142183c06139818c87c2e401c818fec4">写入配置:
<span class="notion-red"><b>注意：编辑前请注释多余的配置，以下配置必须写在HTTP模块里.</b></span></div><div class="notion-text notion-block-142183c0613981b8acc8d271b2f719c3">参考：</div><hr class="notion-hr notion-block-142183c061398128a1f0c8c4db454d4b"/><div class="notion-text notion-block-142183c06139819b8a94c026e9611469">这条命令用于配置 SELinux（安全增强型 Linux），允许 Apache web 服务器（httpd）建立网络连接。默认情况下，SELinux 的策略可能会限制 httpd 进程只能访问与其服务相关的端口。</div><div class="notion-text notion-block-142183c0613981d5b7f3c31cda18f6d4">设置开机执行并且立即启动</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c0613981f78576f23bdcecf4ab" data-id="142183c0613981f78576f23bdcecf4ab"><span><div id="142183c0613981f78576f23bdcecf4ab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c0613981f78576f23bdcecf4ab" title="添加DNS解析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">添加DNS解析</span></span></h3><div class="notion-text notion-block-142183c0613981059416f02cb05dabbe">加入：</div><div class="notion-blank notion-block-142183c0613981c3b97ec9615f513a7f"> </div><div class="notion-text notion-block-142183c06139814aa842d87d69e1b29e">重启DNS服务器</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-142183c06139813b8839d7785a4ea9d6" data-id="142183c06139813b8839d7785a4ea9d6"><span><div id="142183c06139813b8839d7785a4ea9d6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#142183c06139813b8839d7785a4ea9d6" title="测试"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">测试</span></span></h3><div class="notion-text notion-block-142183c0613981cdab4bf59d2b3e5372">使用 curl 命令 进行验证，如：</div><div class="notion-text notion-block-142183c06139816e9d33d9bc5ba336ad"><span class="notion-red"><b>提示：若无法连接请检查防火墙是否放行相应端口，DNS解析配置是否正常，配置完是否重启了DNS服务器,是否更改了SELinux安全策略</b></span></div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>