1
0
mirror of https://gitee.com/coder-xiaomo/notes synced 2025-01-11 20:18:16 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
notes/docs/.vuepress/dist/web-server/index.html

115 lines
44 KiB
HTML
Raw Normal View History

2021-12-26 20:44:44 +08:00
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.27">
<link rel="icon" href="/images/logo.png"><link rel="stylesheet" href="/css/search.css"><title>第一期学习活动 | Coz的学习笔记</title><meta name="description" content="这是我的第一个 VuePress 站点">
<link rel="preload" href="/assets/js/runtime~app.f7ccc4cf.js" as="script"><link rel="preload" href="/assets/css/styles.792c48da.css" as="style"><link rel="preload" href="/assets/js/567.6fcf9384.js" as="script"><link rel="preload" href="/assets/js/app.159ad4c9.js" as="script">
<link rel="stylesheet" href="/assets/css/styles.792c48da.css">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/" class=""><!----><span class="site-name can-hide">Coz的学习笔记</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/" class="nav-link" aria-label="首页"><!--[--><!--]--> 首页 <!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="目录"><span class="title">目录</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="目录"><span class="title">目录</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/guide" class="nav-link" aria-label="目录"><!--[--><!--]--> 目录 <!--[--><!--]--></a></li><li class="dropdown-item"><!--[--><h4 class="dropdown-subtitle"><span>笔记</span></h4><ul class="dropdown-subitem-wrapper"><!--[--><li class="dropdown-subitem"><a href="/computer-networks" class="nav-link" aria-label="计算机网络笔记"><!--[--><!--]--> 计算机网络笔记 <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="dropdown-item"><!--[--><h4 class="dropdown-subtitle"><span>其他</span></h4><ul class="dropdown-subitem-wrapper"><!--[--><li class="dropdown-subitem"><a aria-current="page" href="/web-server/" class="router-link-active router-link-exact-active nav-link router-link-active" aria-label="Web服务器"><!--[--><!--]--> Web服务器 <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><!--]--></ul><!--]--></div></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><form class="search-box" role="search"><input type="search" placeholder="在笔记中搜索一下..." autocomplete="off" spellcheck="false" value><!----></form></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/" class="nav-link" aria-label="首页"><!--[--><!--]--> 首页 <!--[--><!--]--></a></div><div class="navbar-links-item"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="目录"><span class="title">目录</span><span class="arrow down"></span></button><button class="mobile-dropdown-title" type="button" aria-label="目录"><span class="title">目录</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="nav-dropdown"><!--[--><li class="dropdown-item"><a href="/guide
Host: info.cern.ch
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Pragma: no-cache
Cache-Control: no-cache
HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 12:28:56 GMT
Server: Apache
Last-Modified: Thu, 03 Dec 1992 08:37:20 GMT
ETag: &quot;8a9-291e721905000&quot;
Accept-Ranges: bytes
Content-Length: 2217
Connection: close
Content-Type: text/html
&lt;HEADER&gt;
&lt;TITLE&gt;The World Wide Web project&lt;/TITLE&gt;
&lt;NEXTID N=&quot;55&quot;&gt;
&lt;/HEADER&gt;
&lt;BODY&gt;
&lt;H1&gt;World Wide Web&lt;/H1&gt;The WorldWideWeb (W3) is a wide-area&lt;A
NAME=0 HREF=&quot;WhatIs.html&quot;&gt;
hypermedia&lt;/A&gt; information retrieval
initiative aiming to give universal
access to a large universe of documents.&lt;P&gt;
Everything there is online about
W3 is linked directly or indirectly
to this document, including an &lt;A
NAME=24 HREF=&quot;Summary.html&quot;&gt;executive
summary&lt;/A&gt; of the project, &lt;A
NAME=29 HREF=&quot;Administration/Mailing/Overview.html&quot;&gt;Mailing lists&lt;/A&gt;
, &lt;A
NAME=30 HREF=&quot;Policy.html&quot;&gt;Policy&lt;/A&gt; , November&#39;s &lt;A
NAME=34 HREF=&quot;News/9211.html&quot;&gt;W3 news&lt;/A&gt; ,
&lt;A
NAME=41 HREF=&quot;FAQ/List.html&quot;&gt;Frequently Asked Questions&lt;/A&gt; .
&lt;DL&gt;
&lt;DT&gt;&lt;A
NAME=44 HREF=&quot;../DataSources/Top.html&quot;&gt;What&#39;s out there?&lt;/A&gt;
&lt;DD&gt; Pointers to the
world&#39;s online information,&lt;A
NAME=45 HREF=&quot;../DataSources/bySubject/Overview.html&quot;&gt; subjects&lt;/A&gt;
, &lt;A
NAME=z54 HREF=&quot;../DataSources/WWW/Servers.html&quot;&gt;W3 servers&lt;/A&gt;, etc.
&lt;DT&gt;&lt;A
NAME=46 HREF=&quot;Help.html&quot;&gt;Help&lt;/A&gt;
&lt;DD&gt; on the browser you are using
&lt;DT&gt;&lt;A
NAME=13 HREF=&quot;Status.html&quot;&gt;Software Products&lt;/A&gt;
&lt;DD&gt; A list of W3 project
components and their current state.
(e.g. &lt;A
NAME=27 HREF=&quot;LineMode/Browser.html&quot;&gt;Line Mode&lt;/A&gt; ,X11 &lt;A
NAME=35 HREF=&quot;Status.html#35&quot;&gt;Viola&lt;/A&gt; , &lt;A
NAME=26 HREF=&quot;NeXT/WorldWideWeb.html&quot;&gt;NeXTStep&lt;/A&gt;
, &lt;A
NAME=25 HREF=&quot;Daemon/Overview.html&quot;&gt;Servers&lt;/A&gt; , &lt;A
NAME=51 HREF=&quot;Tools/Overview.html&quot;&gt;Tools&lt;/A&gt; ,&lt;A
NAME=53 HREF=&quot;MailRobot/Overview.html&quot;&gt; Mail robot&lt;/A&gt; ,&lt;A
NAME=52 HREF=&quot;Status.html#57&quot;&gt;
Library&lt;/A&gt; )
&lt;DT&gt;&lt;A
NAME=47 HREF=&quot;Technical.html&quot;&gt;Technical&lt;/A&gt;
&lt;DD&gt; Details of protocols, formats,
program internals etc
&lt;DT&gt;&lt;A
NAME=40 HREF=&quot;Bibliography.html&quot;&gt;Bibliography&lt;/A&gt;
&lt;DD&gt; Paper documentation
on W3 and references.
&lt;DT&gt;&lt;A
NAME=14 HREF=&quot;People.html&quot;&gt;People&lt;/A&gt;
&lt;DD&gt; A list of some people involved
in the project.
&lt;DT&gt;&lt;A
NAME=15 HREF=&quot;History.html&quot;&gt;History&lt;/A&gt;
&lt;DD&gt; A summary of the history
of the project.
&lt;DT&gt;&lt;A
NAME=37 HREF=&quot;Helping.html&quot;&gt;How can I help&lt;/A&gt; ?
&lt;DD&gt; If you would like
to support the web..
&lt;DT&gt;&lt;A
NAME=48 HREF=&quot;../README.html&quot;&gt;Getting code&lt;/A&gt;
&lt;DD&gt; Getting the code by&lt;A
NAME=49 HREF=&quot;LineMode/Defaults/Distribution.html&quot;&gt;
anonymous FTP&lt;/A&gt; , etc.&lt;/A&gt;
&lt;/DL&gt;
&lt;/BODY&gt;
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br></div></div><p><strong>请求</strong></p><p>MethodGET</p><p>URI/hypertext/WWW/TheProject.html</p><p>HTTP版本HTTP/1.1</p><p>Headers</p><p>Host: info.cern.ch User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,<em>/</em>;q=0.8 Accept-Language: zh-CN,zh;q=0.8,z
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span><span class="token punctuation">&gt;</span></span>这是我的第一个网页!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span>
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>使用浏览器去访问自己写的这个TCP Server截图展示访问效果</p><p>然后使用前一天自己编写的TCP Client去请求这个Server通过Client将这个网页内容打印出来</p><h3 id="作业-4" tabindex="-1"><a class="header-anchor" href="#作业-4" aria-hidden="true">#</a> 作业</h3><h2 id="★-第8天" tabindex="-1"><a class="header-anchor" href="#★-第8天" aria-hidden="true">#</a> ★ 第8天</h2><h3 id="任务-改造tcp-server-发送一个html文件" tabindex="-1"><a class="header-anchor" href="#任务-改造tcp-server-发送一个html文件" aria-hidden="true">#</a> 任务改造TCP Server发送一个HTML文件</h3><p>学习资料同任务4 作业今天的任务只有一个改动就是将第五天任务中的TCP Server返回的那个网页内容改为从文件中加载而不是固定写死在代码中。</p><h2 id="★-第9天" tabindex="-1"><a class="header-anchor" href="#★-第9天" aria-hidden="true">#</a> ★ 第9天</h2><h3 id="任务-使用多线程" tabindex="-1"><a class="header-anchor" href="#任务-使用多线程" aria-hidden="true">#</a> 任务:使用多线程</h3><p>学习资料同任务4 作业: 在原来TCP Server基础上进行改造当服务器收到连接请求时启动一个单独的线程进行处理。并且不要关闭连接继续监听这个客户端后续的请求。</p><p>附件:<a href="/web-server/files/day3-Linux%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B.pdf">Linux网络编程.pdf</a></p><h3 id="作业-5" tabindex="-1"><a class="header-anchor" href="#作业-5" aria-hidden="true">#</a> 作业</h3><h2 id="第10天" tabindex="-1"><a class="header-anchor" href="#第10天" aria-hidden="true">#</a> 第10天</h2><h3 id="任务-设计并使用配置文件" tabindex="-1"><a class="header-anchor" href="#任务-设计并使用配置文件" aria-hidden="true">#</a> 任务:设计并使用配置文件</h3><p>学习资料:无 作业: Web服务器一般会拥有多个参数将服务器绑定的IP、端口、HTML文件所在的目录写在配置文件中程序启动的时候进行加载。</p><p>需要自己设计自己的Web服务器的文件格式可以参考JSON、XML、YML等格式</p><h3 id="作业-6" tabindex="-1"><a class="header-anchor" href="#作业-6" aria-hidden="true">#</a> 作业</h3><iframe src="/web-server/files/day10-conf.json"></iframe><p><img src="/assets/img/day10-conf-image.07fa24a3.png" alt="day10-conf-image"></p><h3 id="作业-7" tabindex="-1"><a class="header-anchor" href="#作业-7" aria-hidden="true">#</a> 作业</h3><h3 id="作业-8" tabindex="-1"><a class="header-anchor" href="#作业-8" aria-hidden="true">#</a> 作业</h3><h3 id="作业-9" tabindex="-1"><a class="header-anchor" href="#作业-9" aria-hidden="true">#</a> 作业</h3><h3 id="作业-10" tabindex="-1"><a class="header-anchor" href="#作业-10" aria-hidden="true">#</a> 作业</h3><hr><p>11.29 11:01 其他人的作业</p><h1 id="笔记" tabindex="-1"><a class="header-anchor" href="#笔记" aria-hidden="true">#</a> 笔记</h1><h4 id="回答轩辕大佬的问题" tabindex="-1"><a class="header-anchor" href="#回答轩辕大佬的问题" aria-hidden="true">#</a> 回答轩辕大佬的问题:</h4><h5 id="_1-web服务器-约等于-http服务器-其他服务" tabindex="-1"><a class="header-anchor" href="#_1-web服务器-约等于-http服务器-其他服务" aria-hidden="true">#</a> 1.Web服务器 约等于 HTTP服务器 + 其他服务</h5><p>(先不去管它这些操作具体的名称,单纯记录他的操作,后面再补) 包含拿到数据包之后解包的东西、解析客户端的意图的东西、进行分类处理或是提供某种文件、或是处理数据的东西、将结果装入缓冲区的东西、将以HTTP协议格式打包的东西、将该数据包推入Internet的<74><E79A84>
<script src="/assets/js/runtime~app.f7ccc4cf.js" defer></script><script src="/assets/js/567.6fcf9384.js" defer></script><script src="/assets/js/app.159ad4c9.js" defer></script>
</body>
</html>