<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Posts on 我的个人博客</title>
        <link>https://liangjinzhi.com/posts/</link>
        <description>Recent content in Posts on 我的个人博客</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>zh-cn</language>
        <lastBuildDate>Thu, 02 Jul 2026 21:06:43 +0800</lastBuildDate><atom:link href="https://liangjinzhi.com/posts/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>My First Post</title>
            <link>https://liangjinzhi.com/posts/my-first-post/</link>
            <pubDate>Thu, 02 Jul 2026 21:06:43 +0800</pubDate>
            <guid>https://liangjinzhi.com/posts/my-first-post/</guid>
            <description>&lt;p&gt;这是文章正文&amp;hellip;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Certd全自动证书管理系统</title>
            <link>https://liangjinzhi.com/certd-ssl-auto-renewal-system/</link>
            <pubDate>Tue, 30 Jun 2026 03:28:12 +0000</pubDate>
            <guid>https://liangjinzhi.com/certd-ssl-auto-renewal-system/</guid>
            <description>&lt;h2 id=&#34;背景&#34;&gt;背景&#xA;&lt;/h2&gt;&lt;p&gt;公司网站ssl证书每次需要人工更新ssl证书，网站域名一多就容易出问题，要么操作麻烦，要么就是忘记了。&lt;/p&gt;&#xA;&lt;h2 id=&#34;解决方案&#34;&gt;解决方案&#xA;&lt;/h2&gt;&lt;p&gt;部署Certd平台，实现&lt;/p&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    自动申请证书&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    自动续签&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    统一证书管理&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;部署方式&#34;&gt;部署方式&#xA;&lt;/h2&gt;&lt;p&gt;Docker部署Certd&lt;/p&gt;&#xA;&lt;h2 id=&#34;实现效果&#34;&gt;实现效果&#xA;&lt;/h2&gt;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    证书更新从“人工操作” → “自动续期”&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    避免证书过期导致服务中断&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    降低运维维护成本&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;运行截图&#34;&gt;运行截图&#xA;&lt;/h2&gt;&lt;p&gt;首页&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1899&#34; height=&#34;627&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/01-01-2.webp&#34; alt=&#34;&#34; class=&#34;wp-image-318&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;证书自动化流水线&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1702&#34; height=&#34;651&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/02.webp&#34; alt=&#34;&#34; class=&#34;wp-image-319&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;执行历史记录&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1667&#34; height=&#34;638&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/03.webp&#34; alt=&#34;&#34; class=&#34;wp-image-320&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>【K3s 系列 01】从零搭建 K3s</title>
            <link>https://liangjinzhi.com/k3s-01/</link>
            <pubDate>Mon, 29 Jun 2026 09:19:11 +0000</pubDate>
            <guid>https://liangjinzhi.com/k3s-01/</guid>
            <description>&lt;h2 id=&#34;一获取系统基础硬件信息&#34;&gt;一、获取系统基础硬件信息&#xA;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;#基础架构 （输出参考：如果是 x86_64 或 aarch64，即可完美支持。）&#xA;pig@vm-debian-13:~$ uname -m&#xA;x86_64&lt;/p&gt;&#xA;&lt;p&gt;#处理器 （K3s 单节点极其轻量，最低仅需 1核 CPU 和 512MB 内存（推荐 1核1G 以上）。）&#xA;pig@vm-debian-13:~$ lscpu | grep -E &amp;ldquo;Model name|CPU(s):&amp;rdquo;&#xA;CPU(s):                                  2&#xA;Model name:                              13th Gen Intel(R) Core(TM) i5-13400&#xA;NUMA node0 CPU(s):                       0,1&lt;/p&gt;&#xA;&lt;p&gt;#内存大小&#xA;pig@vm-debian-13:~$ free -m&#xA;total        used        free      shared  buff/cache   available&#xA;Mem:            3883         886        1917           0        1334        2997&#xA;Swap:              0           0   &lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;安装脚本&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;官方的脚本太慢，国内用户使用这个脚本进行加速&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ curl -sfL &lt;a class=&#34;link&#34; href=&#34;https://rancher-mirror.rancher.cn/k3s/k3s-install.sh&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://rancher-mirror.rancher.cn/k3s/k3s-install.sh&lt;/a&gt; | INSTALL_K3S_MIRROR=cn sh -&lt;/code&gt;&lt;/pre&gt;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1238&#34; height=&#34;505&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-74.png&#34; alt=&#34;&#34; class=&#34;wp-image-340&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;检查k3s服务状态&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ systemctl status k3s&lt;/code&gt;&lt;/pre&gt;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;858&#34; height=&#34;270&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-32.png&#34; alt=&#34;&#34; class=&#34;wp-image-147&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-32.png 858w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-32-300x94.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-32-768x242.png 768w&#34; sizes=&#34;auto, (max-width: 858px) 100vw, 858px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;查看集群节点状态&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ sudo kubectl get node&lt;/code&gt;&lt;/pre&gt;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;816&#34; height=&#34;64&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-33.png&#34; alt=&#34;&#34; class=&#34;wp-image-148&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-33.png 816w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-33-300x24.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-33-768x60.png 768w&#34; sizes=&#34;auto, (max-width: 816px) 100vw, 816px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;查看集群中运行的pod&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ sudo kubectl get pods -A&lt;/code&gt;&lt;/pre&gt;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;942&#34; height=&#34;135&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-34.png&#34; alt=&#34;&#34; class=&#34;wp-image-149&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-34.png 942w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-34-300x43.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-34-768x110.png 768w&#34; sizes=&#34;auto, (max-width: 942px) 100vw, 942px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://docs.k3s.io/zh/quick-start&#34; data-type=&#34;link&#34; data-id=&#34;https://docs.k3s.io/zh/quick-start&#34;&gt;K3s 官方经典架构与安装文档&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;二配置kubectl-普通用户&#34;&gt;二、配置kubectl （普通用户）&#xA;&lt;/h2&gt;&lt;p&gt;普通用户执行命令 &lt;em&gt;&lt;kbd&gt;kubectl get nodes&lt;/kbd&gt;&lt;/em&gt; 提示没有权限&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;934&#34; height=&#34;127&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-35.png&#34; alt=&#34;&#34; class=&#34;wp-image-151&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-35.png 934w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-35-300x41.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-35-768x104.png 768w&#34; sizes=&#34;auto, (max-width: 934px) 100vw, 934px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;pig@vm-debian:~$ mkdir -p &lt;del&gt;/.kube   #创建 .kube 目录&#xA;pig@vm-debian:&lt;/del&gt;$ sudo cp /etc/rancher/k3s/k3s.yaml  &lt;del&gt;/.kube/config #复制 K3s 默认配置&#xA;pig@vm-debian:&lt;/del&gt;$ sudo chown $USER:$USER &lt;del&gt;/.kube/config #修改文件所属用户&#xA;pig@vm-debian:&lt;/del&gt;$ echo &amp;rsquo;export KUBECONFIG=$HOME/.kube/config&amp;rsquo; &amp;gt;&amp;gt; ~/.bashrc #配置环境变量&#xA;source &lt;del&gt;/.bashrc&#xA;pig@vm-debian:&lt;/del&gt;$ kubectl get nodes #验证配置&#xA;NAME           STATUS   ROLES           AGE    VERSION&#xA;vm-debian-13   Ready    control-plane   175m   v1.35.5+k3s1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;如上，说明当前普通用户已经可以正常访问 Kubernetes API。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;运维思考&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;生产环境中，不建议长期使用root用户进行Kubernetes管理。&lt;/p&gt;&#xA;&lt;p&gt;推荐使用普通用户，通过 &lt;kbd&gt;sudo&lt;/kbd&gt; 执行系统级操作（如管理服务、修改配置），而将 &lt;kbd&gt;kubectl&lt;/kbd&gt; 配置为普通用户直接使用。&lt;/p&gt;&#xA;&lt;p&gt;这样既符合Linux最小权限原则，也更符合企业运维的实际工作方式。&lt;/p&gt;&#xA;&lt;h2 id=&#34;三配置dashboard&#34;&gt;三、配置dashboard&#xA;&lt;/h2&gt;&lt;p&gt;为了避免下载失败的情况，这里使用国内可访问的镜像仓库&lt;/p&gt;&#xA;&lt;h3 id=&#34;31下载yaml&#34;&gt;3.1下载YAML&#xA;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;wget &lt;a class=&#34;link&#34; href=&#34;https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;32修改类似内容&#34;&gt;3.2修改类似内容&#xA;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;找到类似内容：&lt;/p&gt;&#xA;&lt;p&gt;image: kubernetesui/dashboard:v2.7.0&lt;/p&gt;&#xA;&lt;p&gt;改成（示例）：&lt;/p&gt;&#xA;&lt;p&gt;image: docker.m.daocloud.io/kubernetesui/dashboard:v2.7.0&lt;/p&gt;&#xA;&lt;p&gt;再找到：&lt;/p&gt;&#xA;&lt;p&gt;image: kubernetesui/metrics-scraper:v1.0.8&lt;/p&gt;&#xA;&lt;p&gt;改成：&lt;/p&gt;&#xA;&lt;p&gt;image: docker.m.daocloud.io/kubernetesui/metrics-scraper:v1.0.8&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;33开始部署&#34;&gt;3.3开始部署&#xA;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;$ kubectl apply -f recommended.yaml&#xA;namespace/kubernetes-dashboard unchanged&#xA;serviceaccount/kubernetes-dashboard unchanged&#xA;service/kubernetes-dashboard unchanged&#xA;secret/kubernetes-dashboard-certs unchanged&#xA;secret/kubernetes-dashboard-csrf unchanged&#xA;secret/kubernetes-dashboard-key-holder unchanged&#xA;configmap/kubernetes-dashboard-settings unchanged&#xA;role.rbac.authorization.k8s.io/kubernetes-dashboard unchanged&#xA;clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard unchanged&#xA;rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard unchanged&#xA;clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard unchanged&#xA;deployment.apps/kubernetes-dashboard configured&#xA;service/dashboard-metrics-scraper unchanged&#xA;deployment.apps/dashboard-metrics-scraper configured&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;3.4验证是否成功&lt;/p&gt;&#xA;&lt;p&gt;这里有2个之前创建创建的pod&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ kubectl get pods -n kubernetes-dashboard&#xA;NAME                                         READY   STATUS              RESTARTS   AGE&#xA;dashboard-metrics-scraper-7764d6f57c-r26sm   0/1     ContainerCreating   0          13m&#xA;dashboard-metrics-scraper-8d46b45f6-4c6bv    0/1     ContainerCreating   0          23h&#xA;kubernetes-dashboard-659cf4fdd5-l2gp9        0/1     ContainerCreating   0          13m&#xA;kubernetes-dashboard-b44857bbb-9k9kc         0/1     ContainerCreating   0          23h&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;这里READY一直是0，失败了，需要 排查一下。&lt;/p&gt;&#xA;&lt;p&gt;查看pod卡在哪里了&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectkubectl describe pod -n kubernetes-dashboard-659cf4fdd5-l2gp9&#xA;No resources found in kubernetes-dashboard-659cf4fdd5-l2gp9 namespace.&#xA;pig@vm-debian:&lt;del&gt;$&#xA;pig@vm-debian:&lt;/del&gt;$ kubectl describe pod -n kubernetes-dashboard dashboard-metrics-scraper-7764d6f57c-r26sm |tail&#xA;Warning  FailedCreatePodSandBox  17m                 kubelet            Failed to create pod sandbox: rpc error: code = DeadlineExceeded desc = failed to start sandbox &amp;ldquo;74e4795e553dc82c49e53c89a724293525e65e3134fa2ae09787ff197831d938&amp;rdquo;: failed to get sandbox image &amp;ldquo;rancher/mirrored-pause:3.6&amp;rdquo;: failed to pull image &amp;ldquo;rancher/mirrored-pause:3.6&amp;rdquo;: failed to pull and unpack image &amp;ldquo;docker.io/rancher/mirrored-pause:3.6&amp;rdquo;: failed to resolve reference &amp;ldquo;docker.io/rancher/mirrored-pause:3.6&amp;rdquo;: failed to do request: Head &amp;ldquo;&lt;a class=&#34;link&#34; href=&#34;https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.6%22&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.6&#34;&lt;/a&gt;: dial tcp 182.50.139.56:443: i/o timeout-n kubernetes-dashboard-659cf4fdd5-l2gp9&#xA;No resources found in kubernetes-dashboard-659cf4fdd5-l2gp9 namespace.&#xA;pig@vm-debian:&lt;del&gt;$&#xA;pig@vm-debian:&lt;/del&gt;$ kubectl describe pod -n kubernetes-dashboard dashboard-metrics-scraper-7764d6f57c-r26sm |tail&#xA;Warning  FailedCreatePodSandBox  17m                 kubelet            Failed to create pod sandbox: rpc error: code = DeadlineExceeded desc = failed to start sandbox &amp;ldquo;74e4795e553dc82c49e53c89a724293525e65e3134fa2ae09787ff197831d938&amp;rdquo;: failed to get sandbox image &amp;ldquo;rancher/mirrored-pause:3.6&amp;rdquo;: failed to pull image &amp;ldquo;rancher/mirrored-pause:3.6&amp;rdquo;: failed to pull and unpack image &amp;ldquo;docker.io/rancher/mirrored-pause:3.6&amp;rdquo;: failed to resolve reference &amp;ldquo;docker.io/rancher/mirrored-pause:3.6&amp;rdquo;: failed to do request: Head &amp;ldquo;&lt;a class=&#34;link&#34; href=&#34;https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.6%22&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.6&#34;&lt;/a&gt;: dial tcp 182.50.139.56:443: i/o timeout&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;Kubernetes 无法拉取 pause 镜像（sandbox基础镜像）&lt;/p&gt;&#xA;&lt;p&gt;解决方案：&lt;/p&gt;&#xA;&lt;code&gt;&#xA;#修改 K3s 的 pause 镜像&#xA;$ sudo vi  /etc/rancher/k3s/registries.yaml #编辑以下文件&#xA;mirrors:&#xA;  docker.io:&#xA;    endpoint:&#xA;      - &#34;https://docker.m.daocloud.io&#34;&#xA;&lt;p&gt;#然后进行重启&#xA;$sudo systemctl restart k3s&lt;/p&gt;&#xA;&lt;p&gt;$ kubectl get pods -n kubernetes-dashboard  #这个时候已经创建成功了&#xA;NAME                                         READY   STATUS    RESTARTS        AGE&#xA;dashboard-metrics-scraper-7764d6f57c-r26sm   1/1     Running   0               28m&#xA;kubernetes-dashboard-659cf4fdd5-l2gp9        1/1     Running   1 (2m45s ago)   28m&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;3.4配置Dashboard进行访问&lt;/p&gt;&#xA;&lt;p&gt;可以通过 kubectl proxy，或者配置NodePort进行进行访问。&lt;/p&gt;&#xA;&lt;p&gt;我们这里通过配置NodePort来继续。&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$kubectl edit svc -n kubernetes-dashboard kubernetes-dashboard&#xA;#找到：&#xA;type: ClusterIP&#xA;#修改成&#xA;type: NodePort&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;$kubectl get svc -n kubernetes-dashboard #查看端口&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1020&#34; height=&#34;130&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-71.png&#34; alt=&#34;&#34; class=&#34;wp-image-336&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;主机访问：https://ip:port&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1495&#34; height=&#34;606&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-72.png&#34; alt=&#34;&#34; class=&#34;wp-image-337&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;生成token&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$ kubectl -n kubernetes-dashboard create token admin-user&#xA;eyJhbGciOiJSUz&amp;hellip;..qGeyA  #这里进行省略输出&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;获取token并进行登录&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;2538&#34; height=&#34;994&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-73.png&#34; alt=&#34;&#34; class=&#34;wp-image-338&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;至此，K3s 单节点环境已完成基础验证，包括：&lt;/p&gt;&#xA;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    kubectl 可用&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    Pod 正常运行&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    Dashboard 可访问并登录成功&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;</description>
        </item><item>
            <title>Loki日志管理</title>
            <link>https://liangjinzhi.com/building-grafana-loki-log-analysis/</link>
            <pubDate>Sat, 27 Jun 2026 03:38:22 +0000</pubDate>
            <guid>https://liangjinzhi.com/building-grafana-loki-log-analysis/</guid>
            <description>&lt;p&gt;5分钟告别传统 SSH 黑框，教你搭建极轻量、纯网页端的自动化日志监控平台。&lt;/p&gt;&#xA;&lt;p&gt;为了确保最高的稳定性和极低的资源消耗，遵循 Grafana 官方推荐的&lt;strong&gt;单机二进制（Binary）部署指导&lt;/strong&gt;（比 Docker 性能更好、更直观）。&lt;/p&gt;&#xA;&lt;p&gt;目标：在已有granfana平台的基础 上部署Loki,并监控服务器的相关日志&lt;/p&gt;&#xA;&lt;p&gt;前提：开放Loki端3000，3100端口&lt;/p&gt;&#xA;&lt;p&gt;准备工作：创建统一目录&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# mkdir -p /opt/loki-stack&lt;/p&gt;&#xA;&lt;h1 id=&#34;cd-optloki-stack&#34;&gt;cd /opt/loki-stack&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/h1&gt;&lt;h2 id=&#34;第一步服务端机器下载并安装-loki&#34;&gt;第一步：服务端机器下载并安装 Loki&#xA;&lt;/h2&gt;&lt;p&gt;Loki 官方提供编译好的单文件二进制包，直接下载解压即可运行。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;1.下载官方二进制包与默认配置&lt;/strong&gt;：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 下载 Loki 主程序&#xA;wget &lt;a class=&#34;link&#34; href=&#34;https://github.com/grafana/loki/releases/download/v3.0.0/loki-linux-amd64.zip&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/grafana/loki/releases/download/v3.0.0/loki-linux-amd64.zip&lt;/a&gt;&#xA;#或者使用国内GitHub镜像下载Loki主程序&#xA;wget &lt;a class=&#34;link&#34; href=&#34;https://ghfast.top/https://github.com/grafana/loki/releases/download/v3.0.0/loki-linux-amd64.zip&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://ghfast.top/https://github.com/grafana/loki/releases/download/v3.0.0/loki-linux-amd64.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;解压&#34;&gt;解压&#xA;&lt;/h1&gt;&lt;p&gt;unzip loki-linux-amd64.zip&#xA;mv loki-linux-amd64 loki&lt;/p&gt;&#xA;&lt;h1 id=&#34;下载官方标准配置文件&#34;&gt;下载官方标准配置文件&#xA;&lt;/h1&gt;&lt;p&gt;wget &lt;a class=&#34;link&#34; href=&#34;https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml&lt;/a&gt; -O loki-config.yaml&#xA;#或者使用ghfast.top代理下载&#xA;#wget &lt;a class=&#34;link&#34; href=&#34;https://ghfast.top/https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://ghfast.top/https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml&lt;/a&gt; -O loki-config.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;2.清空原来的配置文件以添加“自动清理策略”&lt;/strong&gt;（防止撑爆磁盘）： 打开 &lt;code&gt;loki-config.yaml&lt;/code&gt;，在文件末尾添加以下内容：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;auth_enabled: false&lt;/p&gt;&#xA;&lt;p&gt;server:&#xA;http_listen_port: 3100&#xA;grpc_listen_port: 9096&lt;/p&gt;&#xA;&lt;p&gt;common:&#xA;instance_addr: 127.0.0.1&#xA;path_prefix: /tmp/loki&#xA;storage:&#xA;filesystem:&#xA;chunks_directory: /tmp/loki/chunks&#xA;rules_directory: /tmp/loki/rules&#xA;replication_factor: 1&#xA;ring:&#xA;kvstore:&#xA;store: inmemory&lt;/p&gt;&#xA;&lt;p&gt;schema_config:&#xA;configs:&#xA;- from: 2024-01-01&#xA;store: tsdb&#xA;object_store: filesystem&#xA;schema: v13&#xA;index:&#xA;prefix: index_&#xA;period: 24h&lt;/p&gt;&#xA;&lt;p&gt;limits_config:&#xA;retention_period: 168h #地保留7天日志，绝不重复&lt;/p&gt;&#xA;&lt;p&gt;compactor:&#xA;working_directory: /tmp/loki/retention&#xA;compaction_interval: 10m&#xA;retention_enabled: true&#xA;delete_request_store: filesystem # 解决元数据存放问题&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;3.使用 Systemd 保持后台运行&lt;/strong&gt;： 创建系统服务文件 &lt;code&gt;vi /etc/systemd/system/loki.service&lt;/code&gt;：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[Unit]&#xA;Description=Grafana Loki Log Aggregator&#xA;After=network.target&lt;/p&gt;&#xA;&lt;p&gt;[Service]&#xA;Type=simple&#xA;ExecStart=/opt/loki-stack/loki -config.file=/opt/loki-stack/loki-config.yaml&#xA;Restart=on-failure&lt;/p&gt;&#xA;&lt;p&gt;[Install]&#xA;WantedBy=multi-user.target&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;启动 Loki&lt;/strong&gt;：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;systemctl daemon-reload&#xA;systemctl enable loki &amp;ndash;now&lt;/p&gt;&#xA;&lt;h1 id=&#34;检查状态看到-active-running-即成功&#34;&gt;检查状态，看到 active (running) 即成功&#xA;&lt;/h1&gt;&lt;p&gt;systemctl status loki&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;第二步目标机器下载并配置-promtail-收集端&#34;&gt;第二步：目标机器下载并配置 Promtail (收集端)&#xA;&lt;/h2&gt;&lt;p&gt;Promtail 需要在日志收集端部署。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;1.规范创建所有必要目录&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 创建 Promtail 程序及配置目录&#xA;mkdir -p /opt/loki-stack/promtail&lt;/p&gt;&#xA;&lt;h1 id=&#34;创建你要监控的-fastapi-日志存放目录如果研发还没创建的话&#34;&gt;创建你要监控的 FastAPI 日志存放目录（如果研发还没创建的话）&#xA;&lt;/h1&gt;&lt;p&gt;mkdir -p /var/log/fastapi&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;2. 下载并解压主程序&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;进入刚刚创建好的工作目录，下载官方二进制包：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;cd /opt/loki-stack/promtail&lt;/p&gt;&#xA;&lt;h1 id=&#34;下载官方-v300-二进制包&#34;&gt;下载官方 v3.0.0 二进制包&#xA;&lt;/h1&gt;&lt;p&gt;wget &lt;a class=&#34;link&#34; href=&#34;https://github.com/grafana/loki/releases/download/v3.0.0/promtail-linux-amd64.zip&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/grafana/loki/releases/download/v3.0.0/promtail-linux-amd64.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;或者使用-ghproxy-代理加速下载&#34;&gt;或者使用 ghproxy 代理加速下载&#xA;&lt;/h1&gt;&lt;p&gt;wget &lt;a class=&#34;link&#34; href=&#34;https://ghfast.top/https://github.com/grafana/loki/releases/download/v3.0.0/promtail-linux-amd64.zip&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://ghfast.top/https://github.com/grafana/loki/releases/download/v3.0.0/promtail-linux-amd64.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;解压若提示找不到命令请先执行-yum-install-unzip--y&#34;&gt;解压（若提示找不到命令，请先执行 yum install unzip -y）&#xA;&lt;/h1&gt;&lt;p&gt;unzip promtail-linux-amd64.zip&lt;/p&gt;&#xA;&lt;h1 id=&#34;将解压出来的文件重命名方便后续调用&#34;&gt;将解压出来的文件重命名，方便后续调用&#xA;&lt;/h1&gt;&lt;p&gt;mv promtail-linux-amd64 promtail&lt;/p&gt;&#xA;&lt;h1 id=&#34;清理无用的压缩包&#34;&gt;清理无用的压缩包&#xA;&lt;/h1&gt;&lt;p&gt;rm -f promtail-linux-amd64.zip&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;3. 创建配置文件&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;在当前目录下创建配置文件：&lt;code&gt;vi /opt/loki-stack/promtail/promtail-config.yaml&lt;/code&gt;，写入官方标准模板：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;positions: {}&#xA;server:&#xA;http_listen_port: 9080&#xA;grpc_listen_port: 0&lt;/p&gt;&#xA;&lt;p&gt;positions:&#xA;filename: /opt/loki-stack/promtail/positions.yaml&lt;/p&gt;&#xA;&lt;p&gt;clients:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;url: http://10.1.0.14:3100/loki/api/v1/push&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;scrape_configs:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;job_name: fastapi-cluster&#xA;static_configs:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;targets:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;localhost&#xA;labels:&#xA;job: fastapi&#xA;host: api&#xA;&lt;strong&gt;path&lt;/strong&gt;: /home/ubuntu/api/nohup.out  #需要监控的日志文件&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;job_name: fastapi-app-logs&#xA;static_configs:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;targets:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;localhost&#xA;labels:&#xA;job: fastapi&#xA;host: api&#xA;&lt;strong&gt;path&lt;/strong&gt;: /home/ubuntu/api/log/app.log*  #需要监控的日志文件&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;保存退出&lt;/p&gt;&#xA;&lt;p&gt;配置Systemd服务文件&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;vi /etc/systemd/system/promtail.service&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;直接把下面的标准配置贴进去：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[Unit]&#xA;Description=Promtail Log Client&#xA;After=network.target&lt;/p&gt;&#xA;&lt;p&gt;[Service]&#xA;Type=simple&lt;/p&gt;&#xA;&lt;h1 id=&#34;-使用绝对路径确保后台能正确拉起程序和读到配置文件&#34;&gt;👈 使用绝对路径，确保后台能正确拉起程序和读到配置文件&#xA;&lt;/h1&gt;&lt;p&gt;ExecStart=/opt/loki-stack/promtail/promtail -config.file=/opt/loki-stack/promtail/promtail-config.yaml&#xA;Restart=on-failure&lt;/p&gt;&#xA;&lt;p&gt;[Install]&#xA;WantedBy=multi-user.target&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;重新加载并一键启动&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;保存退出后（&lt;code&gt;:wq&lt;/code&gt;），依次执行以下命令让系统识别新服务并运行：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 1. 刷新后台&#xA;systemctl daemon-reload&lt;/p&gt;&#xA;&lt;h1 id=&#34;2-设置开机自启并现在立刻启动它&#34;&gt;2. 设置开机自启，并现在立刻启动它&#xA;&lt;/h1&gt;&lt;p&gt;systemctl enable promtail &amp;ndash;now&lt;/p&gt;&#xA;&lt;h1 id=&#34;3-检查状态&#34;&gt;3. 检查状态&#xA;&lt;/h1&gt;&lt;p&gt;systemctl status promtail&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;直接拉起Promtail服务&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;systemctl restart promtail&#xA;systemctl status promtail&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;安装grafana&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 1. 通过代理地址下载 Grafana 官方商业版/开源版安装包&#xA;wget &lt;a class=&#34;link&#34; href=&#34;https://mirrors.tuna.tsinghua.edu.cn/grafana/apt/pool/main/g/grafana/grafana_10.4.1_amd64.deb&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://mirrors.tuna.tsinghua.edu.cn/grafana/apt/pool/main/g/grafana/grafana_10.4.1_amd64.deb&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;2-使用-dpkg-强制安装&#34;&gt;2. 使用 dpkg 强制安装&#xA;&lt;/h1&gt;&lt;p&gt;sudo dpkg -i grafana_10.4.1_amd64.deb&lt;/p&gt;&#xA;&lt;h1 id=&#34;3-设置开机自启并现在立刻启动&#34;&gt;3. 设置开机自启并现在立刻启动&#xA;&lt;/h1&gt;&lt;p&gt;sudo systemctl daemon-reload&#xA;sudo systemctl enable grafana-server &amp;ndash;now&lt;/p&gt;&#xA;&lt;h1 id=&#34;4-清理安装包&#34;&gt;4. 清理安装包&#xA;&lt;/h1&gt;&lt;p&gt;rm -f grafana_10.4.1_amd64.deb&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;访问 granfana http://ip:3000&lt;/p&gt;&#xA;&lt;h3 id=&#34;添加-loki-数据源&#34;&gt;添加 Loki 数据源&#xA;&lt;/h3&gt;&lt;p&gt;进入主界面后：&lt;/p&gt;&#xA;&lt;ol start=&#34;1&#34; class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    点击左侧菜单栏的 &lt;strong&gt;Connections&lt;/strong&gt;（连接图标），然后选择 &lt;strong&gt;Data sources&lt;/strong&gt;（数据源）。&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    点击右上角的蓝色按钮 &lt;strong&gt;Add data source&lt;/strong&gt;。&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    在搜索框中输入 &lt;code&gt;Loki&lt;/code&gt;，看到 Loki 图标后点击它进入配置页面。&#xA;  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;第三步填写连接地址&#34;&gt;第三步：填写连接地址&#xA;&lt;/h3&gt;&lt;p&gt;在 Loki 配置表单中，你只需要填写一个地方：&lt;/p&gt;&#xA;&lt;ol start=&#34;1&#34; class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    找到 &lt;strong&gt;URL&lt;/strong&gt; 输入框，因为 Loki 和 Grafana 都在这同一台机器上，直接输入本地回环地址即可：&#xA;  &lt;/li&gt;&#xA;&lt;/ol&gt;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;577&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-43-1024x577.png&#34; alt=&#34;&#34; class=&#34;wp-image-190&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-43-1024x577.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-43-300x169.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-43-768x433.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-43.png 1353w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;2回到Explore的 &lt;strong&gt;Run query&lt;/strong&gt; 按钮。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;413&#34; src=&#34;http://liangjinzhi.com/wp-content/uploads/2026/06/image-44-1024x413.jpg&#34; alt=&#34;&#34; class=&#34;wp-image-191&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-44-1024x413.jpg 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-44-300x121.jpg 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-44-768x310.jpg 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-44-1536x620.jpg 1536w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-44-2048x827.jpg 2048w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;ol start=&#34;1&#34; class=&#34;wp-block-list&#34;&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;现在你就可以在屏幕下方尽情翻阅、搜索和过滤这 500M 历史日志以及动态更新的 FastAPI 实时数据了！看看有没有成功刷出来？&lt;/p&gt;&#xA;&lt;h3 id=&#34;-验收&#34;&gt;🔍 验收&#xA;&lt;/h3&gt;&lt;p&gt;服务启动后，你可以静静等待一会。此时 Promtail 已经在后台把日志数据倒腾给 Loki 了。&lt;/p&gt;&#xA;&lt;p&gt;接下来你就可以登录 &lt;code&gt;http://ip:3000&lt;/code&gt;，在 Explore 里面选择 Loki 数据源，通过 &lt;code&gt;{host=&amp;ldquo;api&amp;rdquo;}&lt;/code&gt; 语法，翻阅配置的日志，再也不需要频繁登录服务器了。&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Nginx  htpasswd防护</title>
            <link>https://liangjinzhi.com/nginx-htpasswd-generator/</link>
            <pubDate>Thu, 25 Jun 2026 03:01:36 +0000</pubDate>
            <guid>https://liangjinzhi.com/nginx-htpasswd-generator/</guid>
            <description>&lt;p&gt;今天收到腾讯云的告警信息，原来是昨天部署的grafana被漏洞扫描识别到。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;355&#34; height=&#34;343&#34; src=&#34;http://jinzhiliang.top/wp-content/uploads/2026/06/image-41.png&#34; alt=&#34;&#34; class=&#34;wp-image-181&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-41.png 355w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-41-300x290.png 300w&#34; sizes=&#34;auto, (max-width: 355px) 100vw, 355px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;1安装必要的工具&#34;&gt;1.安装必要的工具&#xA;&lt;/h2&gt;&lt;p&gt;如果系统提示找不到 &lt;code&gt;htpasswd&lt;/code&gt; 命令，请执行以下命令安装工具包：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install -y apache2-utils&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;2-生成密码文件&#34;&gt;2. 生成密码文件&#xA;&lt;/h2&gt;&lt;p&gt;在终端执行以下命令（将 &lt;code&gt;your_username&lt;/code&gt; 替换为你想要设置的登录账号名）：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo htpasswd -c /etc/nginx/.htpasswd your_username&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;执行后，系统会提示你输入两次密码。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;注意&lt;/strong&gt;：在输入密码时，终端不会显示任何字符（包括星号），这是正常的 Linux 安全机制。输完按回车即可。&lt;/p&gt;&#xA;&lt;h2 id=&#34;3-验证文件是否生成&#34;&gt;3. 验证文件是否生成&#xA;&lt;/h2&gt;&lt;p&gt;你可以查看一下文件内容，确保它已经生成：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;cat /etc/nginx/.htpasswd&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;4在-nginx-中启用&#34;&gt;4.在 Nginx 中启用&#xA;&lt;/h2&gt;&lt;p&gt;在nginx 在 &lt;code&gt;location /&lt;/code&gt; 段落内添加如下内容添加如下：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;auth_basic &amp;ldquo;Restricted Access&amp;rdquo;;&#xA;auth_basic_user_file /etc/nginx/.htpasswd;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;5重启-nginx-使配置生效&#34;&gt;5.重启 Nginx 使配置生效&#xA;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;sudo nginx -t      # 检查配置语法是否正确&#xA;sudo systemctl reload nginx&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;6验证&#34;&gt;6.验证 &lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;/h2&gt;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;177&#34; src=&#34;http://jinzhiliang.top/wp-content/uploads/2026/06/image-42-1024x177.png&#34; alt=&#34;&#34; class=&#34;wp-image-182&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-42-1024x177.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-42-300x52.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-42-768x133.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-42.png 1259w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;命令解析&#34;&gt;命令解析：&#xA;&lt;/h3&gt;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    &lt;code&gt;-I&lt;/code&gt;：只获取 HTTP 头信息（快速查看，不下载网页内容）。&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    &lt;code&gt;-L&lt;/code&gt;：跟随重定向（如果服务器返回 301/302，它会自动追踪最终到达的页面）。&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    &lt;code&gt;-w&lt;/code&gt;：输出更详细的状态码和内容类型。&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;当浏览器收到 &lt;code&gt;401 Unauthorized&lt;/code&gt; 和 &lt;code&gt;WWW-Authenticate&lt;/code&gt; 头部时，意味着 Nginx 已经成功接管了该服务的入口。任何自动化扫描器或攻击者在访问该域名时，只会收到这个“未授权”的信号，根本无法触发后面的 Grafana 业务逻辑，也无法探测到具体的服务指纹。&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>关于博客本人</title>
            <link>https://liangjinzhi.com/about-author/</link>
            <pubDate>Mon, 22 Jun 2026 14:37:06 +0000</pubDate>
            <guid>https://liangjinzhi.com/about-author/</guid>
            <description>&lt;p&gt;一名90后运维工程师。热爱折腾技术，通过优化脚本从而实现自动化大量减少日常的重复劳动。日常工作中很多工作内容容易高度重复，因此在这里进行总结，希望能对大家有所帮助。&lt;/p&gt;&#xA;&lt;p&gt;Email：&lt;a&gt;&lt;a class=&#34;link&#34; href=&#34;mailto:500063439@139.com&#34; &gt;500063439@139.com&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;微信号：ssssomeday&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>调整debian根分区为最大空间</title>
            <link>https://liangjinzhi.com/resize-debian-root-partition/</link>
            <pubDate>Sun, 21 Jun 2026 04:18:05 +0000</pubDate>
            <guid>https://liangjinzhi.com/resize-debian-root-partition/</guid>
            <description>&lt;p&gt;安装操作系统的时候配置错了，/home空间分配的空间占了大部分，需要调整为根分区使用最大空间。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;233&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-28-1024x233.png&#34; alt=&#34;&#34; class=&#34;wp-image-115&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-28-1024x233.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-28-300x68.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-28-768x175.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-28.png 1312w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;备份/home目录&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 1. 临时备份 home 目录的数据到 /tmp&#xA;sudo cp -a /home/* /tmp/ 2&amp;gt;/dev/null&lt;/p&gt;&#xA;&lt;h1 id=&#34;2-卸载-home-挂载点&#34;&gt;2. 卸载 /home 挂载点&#xA;&lt;/h1&gt;&lt;p&gt;sudo umount /home&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;切换到其他目录，并停止相关进程，否则不能卸载/home&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 杀掉所有占用 /home 的进程&#xA;sudo fuser -vkm /home&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;调整好后卸载/home&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# 1. 重新卸载&#xA;sudo umount /home&lt;/p&gt;&#xA;&lt;h1 id=&#34;2-删除-home-逻辑卷&#34;&gt;2. 删除 home 逻辑卷&#xA;&lt;/h1&gt;&lt;p&gt;sudo lvremove -y /dev/mapper/vm&amp;ndash;debian&amp;ndash;13&amp;ndash;vg-home&lt;/p&gt;&#xA;&lt;h1 id=&#34;3-100-扩容给根分区&#34;&gt;3. 100% 扩容给根分区&#xA;&lt;/h1&gt;&lt;p&gt;sudo lvextend -l +100%FREE /dev/mapper/vm&amp;ndash;debian&amp;ndash;13&amp;ndash;vg-root&lt;/p&gt;&#xA;&lt;h1 id=&#34;4-刷新文件系统&#34;&gt;4. 刷新文件系统&#xA;&lt;/h1&gt;&lt;p&gt;sudo resize2fs /dev/mapper/vm&amp;ndash;debian&amp;ndash;13&amp;ndash;vg-root&lt;/p&gt;&#xA;&lt;h1 id=&#34;5-清理-fstab-挂载配置&#34;&gt;5. 清理 fstab 挂载配置&#xA;&lt;/h1&gt;&lt;p&gt;sudo sed -i &amp;lsquo;/vm&amp;ndash;debian&amp;ndash;13&amp;ndash;vg-home/d&amp;rsquo; /etc/fstab&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;这样就好了&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;237&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-29-1024x237.png&#34; alt=&#34;&#34; class=&#34;wp-image-116&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-29-1024x237.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-29-300x70.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-29-768x178.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-29.png 1182w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>一套键鼠操作多终端</title>
            <link>https://liangjinzhi.com/use-one-mouse-keyboard-across-devices/</link>
            <pubDate>Tue, 16 Jun 2026 03:32:07 +0000</pubDate>
            <guid>https://liangjinzhi.com/use-one-mouse-keyboard-across-devices/</guid>
            <description>&lt;p&gt;有时候只有一套键盘鼠标，但是有两个终端需要操作，频繁操作插拨移动键鼠不是很方便操作。这个时候如果可以通过应用程序解决这个问题，何乐而不为呢？&lt;/p&gt;&#xA;&lt;p&gt;这里就引出了input leap&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/input-leap/input-leap&#34;&gt;github&lt;/a&gt;上有介绍：Input Leap 是一款模拟 KVM 切换器功能的软件。传统的 KVM 切换器允许用户使用一套键盘和鼠标，通过旋转 KVM 切换器上的旋钮来控制多台计算机。Input Leap 则通过软件实现这一功能，用户只需将鼠标移动到屏幕边缘，或者按下某个按键即可切换到不同的系统。&lt;/p&gt;&#xA;&lt;h2 id=&#34;准备环境&#34;&gt;准备环境&#xA;&lt;/h2&gt;&lt;p&gt;server:win11，inputleap,有鼠标键盘&lt;/p&gt;&#xA;&lt;p&gt;client:debian13 ，,inputleap,无鼠标键盘&lt;/p&gt;&#xA;&lt;h2 id=&#34;下载链接&#34;&gt;下载链接&#xA;&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/input-leap/input-leap/releases/download/v3.0.2/InputLeap_3.0.2_windows_qt6.exe&#34;&gt;windows-server&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/input-leap/input-leap/releases/download/v3.0.2/InputLeap_3.0.2_debian12_amd64.deb&#34;&gt;debian-client&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;安装配置过程&#34;&gt;安装配置过程&#xA;&lt;/h2&gt;&lt;h3 id=&#34;windows安装&#34;&gt;windows安装&#xA;&lt;/h3&gt;&lt;p&gt;没有什么特别就一路默认安装就好了。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;499&#34; height=&#34;392&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-18.png&#34; alt=&#34;&#34; class=&#34;wp-image-97&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-18.png 499w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-18-300x236.png 300w&#34; sizes=&#34;auto, (max-width: 499px) 100vw, 499px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;安装好，桌面生成快捷方式&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;75&#34; height=&#34;74&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-19.png&#34; alt=&#34;&#34; class=&#34;wp-image-98&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;启动并配置Configure Server…&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;512&#34; height=&#34;394&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-20.png&#34; alt=&#34;&#34; class=&#34;wp-image-99&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-20.png 512w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-20-300x231.png 300w&#34; sizes=&#34;auto, (max-width: 512px) 100vw, 512px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;点进去&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;819&#34; height=&#34;582&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-21.png&#34; alt=&#34;&#34; class=&#34;wp-image-100&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-21.png 819w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-21-300x213.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-21-768x546.png 768w&#34; sizes=&#34;auto, (max-width: 819px) 100vw, 819px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;把图标分别进行拖动，确认两个主机之间的位置，最好可以跟实际的屏幕的位置关系一致方便操作，我这里one是windows主机名，debian 是debian的主机名。双击可以修改主机名配置。&lt;/p&gt;&#xA;&lt;h3 id=&#34;debian安装过程&#34;&gt;debian安装过程&#xA;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;sudo apt install ./InputLeap_3.0.2_debian12_amd64.deb -y&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;#完成后直接启动&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;strong&amp;gt;input-leap&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;795&#34; height=&#34;510&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-22.png&#34; alt=&#34;&#34; class=&#34;wp-image-101&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-22.png 795w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-22-300x192.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-22-768x493.png 768w&#34; sizes=&#34;auto, (max-width: 795px) 100vw, 795px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;这样就完成了。&lt;/p&gt;&#xA;&lt;h2 id=&#34;排查思路&#34;&gt;排查思路&#xA;&lt;/h2&gt;&lt;p&gt;通过服务管理器查看日志&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;193&#34; height=&#34;176&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-27.png&#34; alt=&#34;&#34; class=&#34;wp-image-111&#34; /&gt; &lt;/figure&gt; &lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;802&#34; height=&#34;403&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-26.png&#34; alt=&#34;&#34; class=&#34;wp-image-109&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-26.png 802w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-26-300x151.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-26-768x386.png 768w&#34; sizes=&#34;auto, (max-width: 802px) 100vw, 802px&#34; /&gt;&lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;如果中途有问题需要停止server并重新配置，排查思路，查看是否监听24800端口&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;netstat -ano |findstr :24800&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;或者通过任务管理器重启服务进程&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;952&#34; height=&#34;445&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-25.png&#34; alt=&#34;&#34; class=&#34;wp-image-104&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-25.png 952w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-25-300x140.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-25-768x359.png 768w&#34; sizes=&#34;auto, (max-width: 952px) 100vw, 952px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>AWS免费服务器申请教程</title>
            <link>https://liangjinzhi.com/how-to-apply-aws-free-tier/</link>
            <pubDate>Wed, 10 Jun 2026 05:19:32 +0000</pubDate>
            <guid>https://liangjinzhi.com/how-to-apply-aws-free-tier/</guid>
            <description>&lt;p&gt;PART1 注册账号&lt;/p&gt;&#xA;&lt;h2 id=&#34;1准备工作&#34;&gt;1.准备工作：&#xA;&lt;/h2&gt;&lt;ul class=&#34;wp-block-list&#34;&gt;&#xA;  &lt;li&gt;&#xA;    &lt;em&gt;说明：&lt;/em&gt;&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    邮箱地址：建议准备一个未曾关联过AWS的独立邮箱&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    支付方式：必须是一张支持国际支付的信用（Visa,MasterCard或America Express）&#xA;  &lt;/li&gt;&#xA;  &lt;li&gt;&#xA;    手机号码：用于接收验证码&#xA;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;2注册aws账号&#34;&gt;2.注册AWS账号&#xA;&lt;/h2&gt;&lt;p&gt;访问亚马逊官网,&lt;a href=&#34;https://aws.amazon.com/cn/?nc2=h_home&#34;&gt;&lt;a class=&#34;link&#34; href=&#34;https://aws.amazon.com/cn/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://aws.amazon.com/cn/&lt;/a&gt;&lt;/a&gt;，&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;501&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-53-1024x501.avif&#34; alt=&#34;&#34; class=&#34;wp-image-251&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-53-1024x501.avif 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-53-300x147.avif 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-53-768x375.avif 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-53.avif 1475w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;点击右上角的创建账户（2025年7月15日之后 AWS 改版的新政策只能免费使用6个月了，以前是12个月的）&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;794&#34; height=&#34;659&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-54.avif&#34; alt=&#34;&#34; class=&#34;wp-image-252&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-54.avif 794w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-54-300x249.avif 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-54-768x637.avif 768w&#34; sizes=&#34;auto, (max-width: 794px) 100vw, 794px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;注册过程查收邮箱验证码消息。后续还需要填写联系信息和信用卡信息，同时系统会收一笔小额预授权，后面会退回信用卡账户的。请放心。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;617&#34; height=&#34;467&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-2.png&#34; alt=&#34;&#34; class=&#34;wp-image-76&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-2.png 617w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-2-300x227.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-2-440x333.png 440w&#34; sizes=&#34;auto, (max-width: 617px) 100vw, 617px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;后面大致有5个步骤完成注册。&lt;/p&gt;&#xA;&lt;h3 id=&#34;第1步设置密码&#34;&gt;第1步，设置密码： &lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;/h3&gt;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;651&#34; height=&#34;506&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-3.png&#34; alt=&#34;&#34; class=&#34;wp-image-77&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-3.png 651w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-3-300x233.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-3-440x342.png 440w&#34; sizes=&#34;auto, (max-width: 651px) 100vw, 651px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;第2步填写联系人信息&#34;&gt;第2步，填写联系人信息 &lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;/h3&gt;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;613&#34; height=&#34;581&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-4.png&#34; alt=&#34;&#34; class=&#34;wp-image-78&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-4.png 613w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-4-300x284.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-4-440x417.png 440w&#34; sizes=&#34;auto, (max-width: 613px) 100vw, 613px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;第3步填写账单信息&#34;&gt;第3步，填写账单信息&#xA;&lt;/h3&gt;&lt;p&gt;需要注意免费资源使用超标的话会直接从信用卡里面扣费结算。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;819&#34; height=&#34;749&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-5.png&#34; alt=&#34;&#34; class=&#34;wp-image-79&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-5.png 819w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-5-300x274.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-5-768x702.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-5-440x402.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-5-680x622.png 680w&#34; sizes=&#34;auto, (max-width: 819px) 100vw, 819px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;第4步验证手机号&#34;&gt;第4步，验证手机号 &lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;/h3&gt;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;784&#34; height=&#34;815&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-6.png&#34; alt=&#34;&#34; class=&#34;wp-image-80&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-6.png 784w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-6-289x300.png 289w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-6-768x798.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-6-440x457.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-6-680x707.png 680w&#34; sizes=&#34;auto, (max-width: 784px) 100vw, 784px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;第5步选择支持计划&#34;&gt;第5步，选择支持计划&#xA;&lt;/h3&gt;&lt;p&gt;选择免费的基本支持&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;811&#34; height=&#34;862&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-7.png&#34; alt=&#34;&#34; class=&#34;wp-image-81&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-7.png 811w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-7-282x300.png 282w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-7-768x816.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-7-440x468.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-7-680x723.png 680w&#34; sizes=&#34;auto, (max-width: 811px) 100vw, 811px&#34; /&gt; &lt;/figure&gt; &lt;figure class=&#34;wp-block-image size-full&#34;&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;796&#34; height=&#34;749&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-8.png&#34; alt=&#34;&#34; class=&#34;wp-image-82&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-8.png 796w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-8-300x282.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-8-768x723.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-8-440x414.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-8-680x640.png 680w&#34; sizes=&#34;auto, (max-width: 796px) 100vw, 796px&#34; /&gt;&lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;到这里就完成注册了，稍后留意一下注册成功的邮件通知。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;631&#34; height=&#34;613&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-9.png&#34; alt=&#34;&#34; class=&#34;wp-image-83&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-9.png 631w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-9-300x291.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-9-440x427.png 440w&#34; sizes=&#34;auto, (max-width: 631px) 100vw, 631px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;PART2 创建EC2实例&lt;/p&gt;&#xA;&lt;p&gt;收到AWS账户激活的邮件后，登录AWS账户控制台，这里我们选择“根用户”，输入邮箱和密码登录。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;949&#34; height=&#34;725&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-11.png&#34; alt=&#34;&#34; class=&#34;wp-image-85&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-11.png 949w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-11-300x229.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-11-768x587.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-11-440x336.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-11-680x519.png 680w&#34; sizes=&#34;auto, (max-width: 949px) 100vw, 949px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;进入控制台后，选择云服务器所在地区，我这里选择了香港，后面网域的访问或者网络也会更通畅方便一些。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;502&#34; height=&#34;821&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-13.png&#34; alt=&#34;&#34; class=&#34;wp-image-87&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-13.png 502w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-13-183x300.png 183w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-13-440x720.png 440w&#34; sizes=&#34;auto, (max-width: 502px) 100vw, 502px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;创建实例，选择主页中的 “启动实例”，创建第一台EC2实例。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;419&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-1024x419.png&#34; alt=&#34;&#34; class=&#34;wp-image-88&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-1024x419.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-300x123.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-768x314.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-1536x628.png 1536w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-440x180.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14-680x278.png 680w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-14.png 1787w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;按自己所需创建免费的镜像&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1004&#34; height=&#34;1024&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-1004x1024.png&#34; alt=&#34;&#34; class=&#34;wp-image-89&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-1004x1024.png 1004w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-294x300.png 294w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-768x783.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-440x449.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-15-680x694.png 680w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-15.png 1096w&#34; sizes=&#34;auto, (max-width: 1004px) 100vw, 1004px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;创建密钥对，自定义一个密钥的名称，私钥文件格式和你使用的ssh工具有关，根据提示选择。创建好之后点击”创建密钥对”弹出文件下载框，自己保存好，后续使用该密钥对进行访问。&lt;/p&gt;&#xA;&lt;p&gt;配置存储&lt;/p&gt;&#xA;&lt;p&gt;免费每月存储容量是30GB，建议按需使用，为避免超额使用，建议只创建一个实例使用。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;410&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-1024x410.png&#34; alt=&#34;&#34; class=&#34;wp-image-90&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-1024x410.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-300x120.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-768x308.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-440x176.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-16-680x272.png 680w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-16.png 1131w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;配置好，在右边选择启动实例即可。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;621&#34; height=&#34;533&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-17.png&#34; alt=&#34;&#34; class=&#34;wp-image-91&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-17.png 621w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-17-300x257.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-17-440x378.png 440w&#34; sizes=&#34;auto, (max-width: 621px) 100vw, 621px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;这里在控制台就可以看到启动的实例了。&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;123&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-1024x123.png&#34; alt=&#34;&#34; class=&#34;wp-image-86&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-1024x123.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-300x36.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-768x92.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-1536x184.png 1536w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-2048x246.png 2048w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-440x53.png 440w, https://liangjinzhi.com/wp-content/uploads/2026/06/image-12-680x82.png 680w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>AdguardHome容器化部署</title>
            <link>https://liangjinzhi.com/adguardhome-docker-setup/</link>
            <pubDate>Sat, 30 May 2026 06:23:38 +0000</pubDate>
            <guid>https://liangjinzhi.com/adguardhome-docker-setup/</guid>
            <description>&lt;p&gt;家里有linux主机，于是就想到了现在上网的时候经常有太多的网站会有广告，看看能不能通过自建规则减少广告。听说有AdguardHome可以实现这个功能。那么我们来看看如何部署和使用起来。&lt;/p&gt;&#xA;&lt;h2 id=&#34;概述&#34;&gt;概述&#xA;&lt;/h2&gt;&lt;p&gt;ADGUARDHOME是一款网络级广告和跟踪器拦截DNS服务器，作为一款开源的隐私保护工具，它能够在网络层面为所有设备提供广告过滤和隐私保护功能，无需在每个设备上单独安装客户端软件。通过Docker容器化部署ADGUARDHOME，可以实现快速部署、环境隔离和版本管理，适用于家庭网络、小型企业网络等多种场景。&lt;/p&gt;&#xA;&lt;h2 id=&#34;part1-服务端环境准备&#34;&gt;PART1 服务端环境准备&#xA;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;Debian,docker,AdguardHome镜像源&#xA;主机IP:192.168.5.200&lt;/p&gt;&#xA;&lt;p&gt;镜像源可以自行查找&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;编写Docker-compose.yml&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;services:&#xA;adguardhome:&#xA;image: docker.1ms.run/adguard/adguardhome:v0.107.76&#xA;container_name: adguardhome&#xA;restart: unless-stopped&#xA;# 宿主机目录挂载，确保升级或重启时数据不丢失&#xA;volumes:&#xA;- ./ag_work:/opt/adguardhome/work&#xA;- ./ag_conf:/opt/adguardhome/conf&#xA;ports:&#xA;- &amp;ldquo;53:53/tcp&amp;rdquo;&#xA;- &amp;ldquo;53:53/udp&amp;rdquo;&#xA;- &amp;ldquo;8081:8081/tcp&amp;rdquo;&#xA;- &amp;ldquo;443:443/tcp&amp;rdquo;&#xA;- &amp;ldquo;443:443/udp&amp;rdquo;&#xA;- &amp;ldquo;3000:3000/tcp&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;这里因为我本地环境80端口已经启用了，所以把adguardHome的默认80端口修改成8081了。请自行注意&lt;/p&gt;&#xA;&lt;p&gt;启用命令&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo docker compose up -d&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;启动后&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;dog@debian:~/adguard$ docker ps  |grep adguard&#xA;98dd7f0db486   docker.1ms.run/adguard/adguardhome:v0.107.76                                         &amp;ldquo;/opt/adguardhome/Ad…&amp;rdquo;   24 hours ago   Up 16 hours             0.0.0.0:53-&amp;gt;53/tcp, 0.0.0.0:53-&amp;gt;53/udp, [::]:53-&amp;gt;53/tcp, [::]:53-&amp;gt;53/udp, 80/tcp, 67-68/udp, 0.0.0.0:443-&amp;gt;443/tcp, [::]:443-&amp;gt;443/tcp, 853/udp, 853/tcp, 3000/udp, 5443/tcp, 0.0.0.0:3000-&amp;gt;3000/tcp, [::]:3000-&amp;gt;3000/tcp, 0.0.0.0:8081-&amp;gt;8081/tcp, 0.0.0.0:443-&amp;gt;443/udp, [::]:8081-&amp;gt;8081/tcp, [::]:443-&amp;gt;443/udp, 5443/udp, 6060/tcp   adguardhome&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;访问首页，并设置密码&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;629&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-1024x629.png&#34; alt=&#34;&#34; class=&#34;wp-image-40&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-1024x629.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-300x184.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-768x472.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-1536x943.png 1536w, https://liangjinzhi.com/wp-content/uploads/2026/05/image.png 1601w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;回到首页-设置-dns设置&#34;&gt;回到首页-设置-DNS设置&#xA;&lt;/h2&gt;&lt;p&gt;设置上游DNS服务器，直接粘贴&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;https://dns.alidns.com/dns-query&#xA;&lt;a class=&#34;link&#34; href=&#34;https://doh.pub/dns-query&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://doh.pub/dns-query&lt;/a&gt;&#xA;&lt;a class=&#34;link&#34; href=&#34;https://doh.360.cn/dns-query&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://doh.360.cn/dns-query&lt;/a&gt;&#xA;114.114.114.114&#xA;223.5.5.5&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;bootstrap-dns-服务器&#34;&gt;Bootstrap DNS 服务器&#xA;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;223.5.5.5&#xA;119.29.29.29&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;p&gt;点击保存&lt;/p&gt;&#xA;&lt;h3 id=&#34;回到过滤器自定义过滤规则&#34;&gt;回到过滤器，自定义过滤规则&#xA;&lt;/h3&gt;&lt;p&gt;通过指定域名进行拦截，demo如下&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;||dns.weixin.qq.com.cn^&lt;/p&gt;&#xA;&lt;p&gt;应用即可&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;part2-路由器&#34;&gt;PART2 路由器&#xA;&lt;/h2&gt;&lt;p&gt;以中兴路由器为例，网络-配置DNS服务器为服务器端的IP。（我这里是192.168.5.200）&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;511&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-2-1024x511.png&#34; alt=&#34;&#34; class=&#34;wp-image-47&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-2-1024x511.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-2-300x150.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-2-768x383.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-2-1536x767.png 1536w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-2.png 1623w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;part3-终端电脑&#34;&gt;PART3 终端电脑&#xA;&lt;/h2&gt;&lt;p&gt;以win10/win11为例&lt;/p&gt;&#xA;&lt;p&gt;1.按下 Win + R 键，输入 cmd 并按 Enter 打开命令提示符。&lt;br /&gt;2.输入ipconfig /flushdns 刷新DNS缓存&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full is-resized&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;494&#34; height=&#34;311&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-3.png&#34; alt=&#34;&#34; class=&#34;wp-image-48&#34; style=&#34;width:532px;height:auto&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-3.png 494w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-3-300x189.png 300w&#34; sizes=&#34;auto, (max-width: 494px) 100vw, 494px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;p&gt;刷新后，你可以通过以下命令查看当前电脑实际使用的 DNS 服务器地址，确保它确实是你设置的 AdGuardHome 主机 IP&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-full&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;355&#34; height=&#34;241&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-4.png&#34; alt=&#34;&#34; class=&#34;wp-image-49&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-4.png 355w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-4-300x204.png 300w&#34; sizes=&#34;auto, (max-width: 355px) 100vw, 355px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;  &lt;br /&gt;&#xA;&lt;h2 id=&#34;查看效果&#34;&gt;查看效果&#xA;&lt;/h2&gt;&lt;p&gt;通过电脑任意访问一个网站如&lt;a href=&#34;https://news.qq.com/&#34;&gt;&lt;a class=&#34;link&#34; href=&#34;https://news.qq.com/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://news.qq.com/&lt;/a&gt;&lt;/a&gt; 回到查询日志-选择已过滤&lt;/p&gt;&#xA;&lt;figure class=&#34;wp-block-image size-large&#34;&gt;&#xA;&lt;p&gt;&lt;img loading=&#34;lazy&#34; decoding=&#34;async&#34; width=&#34;1024&#34; height=&#34;492&#34; src=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-1-1024x492.png&#34; alt=&#34;&#34; class=&#34;wp-image-42&#34; srcset=&#34;https://liangjinzhi.com/wp-content/uploads/2026/05/image-1-1024x492.png 1024w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-1-300x144.png 300w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-1-768x369.png 768w, https://liangjinzhi.com/wp-content/uploads/2026/05/image-1.png 1534w&#34; sizes=&#34;auto, (max-width: 1024px) 100vw, 1024px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;参考资料&#34;&gt;参考资料&#xA;&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/SeanChang/xuanyuan_docker_proxy/blob/main/blog/adguardhome-docker.md#adguardhome-docker-%E5%AE%B9%E5%99%A8%E5%8C%96%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97&#34;&gt;AdguardHome Docker 容器化部署指南&lt;/a&gt;&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
