-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-search.xml
More file actions
84 lines (40 loc) · 18 KB
/
Copy pathlocal-search.xml
File metadata and controls
84 lines (40 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>【Nginx入门】1.基本介绍和原理解析</title>
<link href="/2023/06/15/%E3%80%90Nginx%E5%85%A5%E9%97%A8%E3%80%911-%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/"/>
<url>/2023/06/15/%E3%80%90Nginx%E5%85%A5%E9%97%A8%E3%80%911-%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/</url>
<content type="html"><![CDATA[<h1 id="第一章:Nginx概述"><a href="#第一章:Nginx概述" class="headerlink" title="第一章:Nginx概述"></a>第一章:Nginx概述</h1><h2 id="1-1、Nginx概述"><a href="#1-1、Nginx概述" class="headerlink" title="1.1、Nginx概述"></a>1.1、Nginx概述</h2><blockquote><p>Nginx(“engine x”)是一个高性能的<span class="label label-danger">HTTP</span>和<span class="label label-danger">反向代理服务器</span>,特点是占有内存少,并发能力强,事实上Nginx的并发能力确实在同类型的网页服务器中表现较好,中国大陆使用Nginx网站用户有:百度、京东、新浪、网易、腾讯、淘宝等。</p><footer><strong>架构师社区</strong><cite><a href="https://mp.weixin.qq.com/s?__biz=MzU0OTE4MzYzMw==&mid=2247516769&idx=3&sn=2c9b6a79c8bd1476d99057caedb1875d&chksm=fbb10b9fccc682899bc443838d327796d909e217a21ba36d5853a31078e6bf81ccc47fc9bf89&scene=27">学习Nginx这一篇就够了</a></cite></footer></blockquote><ol><li><strong>反向代理(Reverse Proxy)</strong><span class="label label-success">是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。</span></li><li><strong>Nginx之所以被称为反向代理</strong>,<span class="label label-default">是因为它在客户端和服务器之间起到了代理的作用,将客户端的请求转发给后端服务器。与传统的正向代理不同,正向代理是为了代表客户端发送请求,隐藏客户端身份,访问互联网上的资源。</span></li><li><strong>Nginx不仅仅支持HTTP协议</strong>,<span class="label label-info">还支持其他协议,如HTTPS、SMTP、POP3、IMAP 等。它具有高性能、高并发处理能力以及灵活的配置选项,使其成为一个流行的反向代理服务器和负载均衡器。(也支持TCP和UDP)</span></li></ol><h2 id="1-2、Nginx官网"><a href="#1-2、Nginx官网" class="headerlink" title="1.2、Nginx官网"></a>1.2、Nginx官网</h2><p>官网地址:<a href="http://nginx.org/">http://nginx.org/</a></p><h2 id="1-3、Nginx用处"><a href="#1-3、Nginx用处" class="headerlink" title="1.3、Nginx用处"></a>1.3、Nginx用处</h2><blockquote><p>Nginx可以作为静态页面的Web服务器,同时还支持CGI协议的动态语言,比如Perl、PHP等。但是不支持Java。Java程序只能通过与Tomcat配合完成。Nginx专为性能优化而开发,性能是其最重要的考量,实现上非常注重效率,能经受高负载的考验,有报告表明能支持高达50000个并发连接数。</p><footer><strong>架构师社区</strong><cite><a href="https://mp.weixin.qq.com/s?__biz=MzU0OTE4MzYzMw==&mid=2247516769&idx=3&sn=2c9b6a79c8bd1476d99057caedb1875d&chksm=fbb10b9fccc682899bc443838d327796d909e217a21ba36d5853a31078e6bf81ccc47fc9bf89&scene=27">学习Nginx这一篇就够了</a></cite></footer></blockquote><div class="note note-success"> <p>CGI协议:CGI(通用网关接口,Common Gateway Interface)是一种用于在Web服务器和应用程序之间进行通信的协议。它定义了Web服务器如何与外部程序(通常是脚本或可执行文件)进行交互,以生成动态的Web内容。</p> </div><pre><code class=" mermaid">flowchart LR a[Nginx] b[CGI协议] c[脚本] d[可执行文件] a-->|请求的参数和其他环境变量|b-->|调用|c & d-.->|CGI协议标准输出|b-.->|返回结果|a</code></pre><p>事实上,Nginx 是一款不支持直接运行 Java 代码的 Web 服务器和反向代理服务器。Nginx 是用 C 语言开发的,其核心功能主要集中在处理 HTTP 和其他网络协议上。</p><p>然而,您可以结合使用 Nginx 和其他工具或技术来支持 Java 应用程序的部署和运行。这通常通过以下两种方式实现:</p><ol><li>反向代理到 Java 应用服务器:您可以将 Nginx 配置为反向代理,将传入的 HTTP 请求转发到运行 Java 应用程序的后端服务器,如 Apache Tomcat、Jetty 或 WildFly 等。Nginx 可以处理静态文件和负载均衡,并将动态请求转发给 Java 应用服务器进行处理。</li><li>使用 Nginx 作为静态文件服务器:您可以使用 Nginx 来提供静态文件,如 HTML、CSS、JavaScript 和图像等。对于动态内容,您可以将请求转发给 Java 应用服务器进行处理,然后将响应返回给客户端。</li></ol><p>这种组合使用 Nginx 和 Java 应用服务器的方式可以发挥各自的优势,例如 Nginx 的高性能、负载均衡和缓存能力以及 Java 应用服务器的 Java 编程能力和企业级功能。</p><p>需要注意的是,有一些其他工具,如 Apache HTTP Server、Apache Traffic Server 或专门用于 Java 应用程序的服务器,如 Apache Tomcat、Jetty 和 WildFly,它们更直接地支持 Java 应用程序的运行。</p>]]></content>
<categories>
<category>服务器</category>
</categories>
<tags>
<tag>服务器</tag>
<tag>反向代理</tag>
<tag>Nginx</tag>
<tag>Tomcat</tag>
</tags>
</entry>
<entry>
<title>从0到1搭建专属博客:Hexo + Fluid + Github Pages + Chatgpt + Midjoruney</title>
<link href="/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/"/>
<url>/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/</url>
<content type="html"><![CDATA[<h1 id="1-背景-🚀"><a href="#1-背景-🚀" class="headerlink" title="1. 背景 🚀"></a>1. 背景 🚀</h1><p>不知不觉就工作两年左右,在这期间也经历了部门动荡(差点被裁员😱)、部门合并、更换经理,感觉自己总是忙于业务(边缘又不受重视),并没有获得什么成长。最近部门内走了很多人,来了也很多人,希望自己居安思危,不断成长。建立这个Blog的目的也是为了记录和督促自己不断学习进步💪。</p><p>最初选博客的时候,也考虑过是不是用现有线上博客会好一点,考虑到线上博客的美观性和灵活性比较差,最后放弃了(其实就是单纯的感觉不够Geek👎,为了装逼😎)。另外的话,也可以看看建站的流程,学习一下,打算自己做做SEO、搞个微信公众号,挣点小外快(想Peach🍑)。</p><p>博客的话肯定是越快建起来越好,毕竟我是一个三分钟热度的人。所以我想的是用<strong>Github Pages</strong>部署,Blog就选择了<strong>Hexo</strong>(相较于jekyll更简单好看~ 颜狗是我😍),Hexo的主题选择<strong>Fluid</strong>。网站内容描述都是<strong>Chatgpt</strong>生成的(语言匮乏星人的救星🤩),然后网站的icon和banner都是<strong>Midjoruney</strong>生成的,看起还不错。</p><p><img src="/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/knelson_Design_an_icon_for_a_blog_owned_by_Ma_Hui._The_content__31540f83-16d0-4042-aa0f-6e40ee958504.png" alt="Midjoruney生成的图标" title="Midjoruney生成的图标,看起来还不错"></p><h1 id="2-博客搭建"><a href="#2-博客搭建" class="headerlink" title="2. 博客搭建"></a>2. 博客搭建</h1><h2 id="2-1-Github-Pages"><a href="#2-1-Github-Pages" class="headerlink" title="2.1 Github Pages"></a>2.1 Github Pages</h2><p><a href="https://pages.github.com/">Github Page 官网</a> (我就简单搬运下Chatgpt的翻译~ 👌)</p><h3 id="(1)创建一个代码仓库"><a href="#(1)创建一个代码仓库" class="headerlink" title="(1)创建一个代码仓库"></a>(1)创建一个代码仓库</h3><blockquote><p>请前往 GitHub,并创建一个名为 “username.github.io” 的新公共代码仓库,<strong>其中 “username” 是您在 GitHub 上的用户名(或组织名)</strong>(这句话特别重要,一定要和自己的github名字一模一样‼️)。<br>如果代码仓库的第一部分与您的用户名不完全匹配,它将无法正常工作,因此请确保正确填写。</p></blockquote><p><img src="https://pages.github.com/images/user-repo@2x.png" alt="Github Pages 官方图片" title="Github Pages 官网图片"></p><h3 id="(2)克隆代码仓库"><a href="#(2)克隆代码仓库" class="headerlink" title="(2)克隆代码仓库"></a>(2)克隆代码仓库</h3><blockquote><p>前往您想要存储项目的文件夹,并克隆新的代码仓库:</p></blockquote><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git clone https://github.com/username/username.github.io<br></code></pre></td></tr></table></figure><h3 id="(3)你好,世界!"><a href="#(3)你好,世界!" class="headerlink" title="(3)你好,世界!"></a>(3)你好,世界!</h3><blockquote><p>进入项目文件夹并添加一个 index.html 文件:</p></blockquote><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">cd username.github.io<br>echo "Hello World" > index.html<br></code></pre></td></tr></table></figure><h3 id="(4)提交更改"><a href="#(4)提交更改" class="headerlink" title="(4)提交更改"></a>(4)提交更改</h3><p>执行以下操作:添加更改、提交更改并推送到远程仓库:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">git add --all<br>git commit -m "Initial commit"<br>git push -u origin main<br></code></pre></td></tr></table></figure><h3 id="(5)你完成了!"><a href="#(5)你完成了!" class="headerlink" title="(5)你完成了!"></a>(5)你完成了!</h3><p>打开浏览器,访问 <a href="https://username.github.io/">https://username.github.io</a></p><h2 id="2-2-Hexo"><a href="#2-2-Hexo" class="headerlink" title="2.2 Hexo"></a>2.2 Hexo</h2><p><a href="https://hexo.io/zh-cn/">Hexo官网</a></p><h3 id="(1)安装Hexo第一步是先安装nodejs"><a href="#(1)安装Hexo第一步是先安装nodejs" class="headerlink" title="(1)安装Hexo第一步是先安装nodejs"></a>(1)安装Hexo第一步是先安装nodejs</h3><p><a href="https://nodejs.org/zh-cn/download">NodeJs下载链接</a> 下载完毕安装就完事了</p><h3 id="(2)安装和启动Hexo"><a href="#(2)安装和启动Hexo" class="headerlink" title="(2)安装和启动Hexo"></a>(2)安装和启动Hexo</h3><p>Hexo的命令比较简单,就是进入上面克隆的仓库,依次执行下面的命令:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install hexo-cli -g # 安装Hexo<br>hexo init blog # 初始化博客<br>cd blog # 进入文件夹<br>npm install # 安装依赖<br>hexo server # 启动博客<br></code></pre></td></tr></table></figure><p>核心命令的话就有4个:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs shell">hexo new [layout] <title> # 创建一个页面<br>hexo clean # 清理编译生成的网页<br>hexo g # 生成网页<br>hexo s # 部署到本地<br>hexo d # 同步到仓库,需配置_config.yml文件<br></code></pre></td></tr></table></figure><p><img src="/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/image-20230612005112441.png" alt="image-20230612005112441" title="_config.yml文件的部署配置"></p><h2 id="2-3-Hexo-Fluid主题"><a href="#2-3-Hexo-Fluid主题" class="headerlink" title="2.3 Hexo-Fluid主题"></a>2.3 Hexo-Fluid主题</h2><p><a href="https://github.com/fluid-dev/hexo-theme-fluid">Github地址</a></p><p><a href="https://hexo.fluid-dev.com/docs/start/">官方手册</a></p><p>这个我就不详细讲了,根据他的文档手册来没有问题。🫡 </p><p>但是按照他的流程有的很问题的点在于有个包没安装,导致创建页面的时候会报错 ‼️</p><p>我看有人在issue里面反馈了,估计后后面会修复。</p><p><img src="https://user-images.githubusercontent.com/135296923/244594427-ff3274eb-244a-4e0b-b6f4-7755c696402a.png" alt="https://github.com/fluid-dev/hexo-theme-fluid/issues/961" title="原图在这里 https://github.com/fluid-dev/hexo-theme-fluid/issues/961"></p><p>解决方案:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install css --save<br></code></pre></td></tr></table></figure><h2 id="2-4-Chatgpt"><a href="#2-4-Chatgpt" class="headerlink" title="2.4 Chatgpt"></a>2.4 Chatgpt</h2><p>神器!!!!!!感觉是每个人都需要的神器!!!😍😍😍</p><p>科学🔬上网 + Google📮邮箱 + 短信服务 就可以注册!网上有很多教程,比如下面这个(不保证可用性、安全性等):</p><p><a href="https://www.leavescn.com/Articles/Content/1213">https://www.leavescn.com/Articles/Content/1213</a></p><p><img src="/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/image-20230612010754841.png" alt="image-20230612010754841" title="生成网站的描述,感觉还可以"></p><h2 id="2-5-Midjoruney"><a href="#2-5-Midjoruney" class="headerlink" title="2.5 Midjoruney"></a>2.5 Midjoruney</h2><p>Midjoruney已经开始收费了,某宝的话可以10块钱就能买一个月的共享账号。Midjoruney的话主要是用来生成一些和网站有关的图片,比如网站的icon,首页的banner等等,避免一些版权纠纷(杞人忧天🤓),也是尝试一下新鲜事物。</p><p>用chatgpt生成详细的描述句,然后用Midjoruney生成图片,感觉还不错。</p><p><img src="/2023/06/11/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E4%B8%93%E5%B1%9E%E5%8D%9A%E5%AE%A2%EF%BC%9AHexo-Fluid-Github-Pages-Chatgpt-Midjoruney/knelson_An_18-year-old_Chinese_male_model_is_seated_in_a_car_su_8ba5ee2b-e4d7-43d8-9843-9f0b4bc003eb.png" title="感觉还不错!汽车 蓝天 鲜花 少年"></p>]]></content>
<categories>
<category>Blog</category>
</categories>
<tags>
<tag>Hexo</tag>
<tag>Fluid</tag>
<tag>Github Pages</tag>
<tag>Chatgpt</tag>
<tag>Midjoruney</tag>
</tags>
</entry>
<entry>
<title>Hello World</title>
<link href="/2023/06/10/hello-world/"/>
<url>/2023/06/10/hello-world/</url>
<content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo new <span class="hljs-string">"My New Post"</span><br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo server<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo generate<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo deploy<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
</entry>
</search>