<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[西门博主]]></title> 
<description><![CDATA[记录学习的一点一滴]]></description>
<link>https://blog.shzhaoqi.com/</link>
<language>zh-cn</language>
<generator>www.emlog.net</generator>
<item>
    <title>SSH 修改默认22端口标准操作流程</title>
    <link>https://blog.shzhaoqi.com/other/100.html</link>
    <description><![CDATA[###第一步：修改 SSH 配置文件（最核心）
1、编辑配置文件：
```
sudo nano /etc/ssh/sshd_config
```
2、找到 #Port 22，去掉 #，把 22 改成你想要的端口（例如 2222）。
3、保存退出（Ctrl+O 回车，Ctrl+X）。

###第二步：处理 Ubuntu 特有的 ssh.socket 覆盖问题（最容易踩坑）

检查：执行 sudo systemctl status ssh，如果看到 TriggeredBy: ● ssh.socket，说明端口被 socket 托管了，必须改这里。
修改：编辑 sudo nano /lib/systemd/system/ssh.socket，把 ListenStream=22 改成 ListenStream=22222。
生效：执行以下命令重新加载并重启：
```
sudo systemctl daemon-reload
sudo systemctl restart ssh.socket
sudo systemctl restart ssh
```
###第三步：检查服务器内部防火墙（UFW）
查看防火墙状态：sudo ufw status
如果状态是 active，必须放行新端口：
```
sudo ufw allow 22222/tcp
sudo ufw reload
```
(这就是你这次最后遇到的卡点，一定要记得！)

###第四步：放行云厂商的安全组
登录你的云厂商控制台（腾讯云/阿里云等）。

找到这台服务器，进入安全组。

在入站规则里，添加一条：

协议端口：TCP:22222

来源：0.0.0.0/0（或你的本机 IP）

策略：允许

###第五步：测试与“保命”操作
先别关旧窗口！ 保持你当前连着的 22 端口 SSH 窗口不要动。

本地终端测试：
```
ssh -p 22222 用户名@你的服务器IP
```
如果新端口能连上，说明大功告成，这时再去 UFW 里删掉旧端口 22 的放行规则（保持最小权限）：
```
sudo ufw delete allow 22/tcp
sudo ufw reload
```
如果新端口连不上，立刻回到旧窗口，把配置改回 22，重启服务，恢复原状再排查。]]></description>
    <pubDate>Thu, 08 Oct 2026 11:01:32 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/100.html</guid>

</item>
<item>
    <title>Supervisor进程管理</title>
    <link>https://blog.shzhaoqi.com/other/99.html</link>
    <description><![CDATA[```
kill 15648

ss -lntp | grep ':8080'

supervisorctl -c /etc/supervisor/supervisord.conf restart landracloud-queue:*
supervisorctl -c /etc/supervisor/supervisord.conf restart landracloud-reverb:*

supervisorctl -c /etc/supervisor/supervisord.conf status //正常情况下不用执行 php artisan reverb:start

php artisan reverb:start

```]]></description>
    <pubDate>Fri, 14 Aug 2026 16:42:02 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/99.html</guid>

</item>
<item>
    <title>一台服务器 多个 Laravel 站点 队列常驻方案</title>
    <link>https://blog.shzhaoqi.com/other/98.html</link>
    <description><![CDATA[每个站点必须：
自己独立的 supervisor 配置文件
自己独立的进程名称（不能重名）
自己独立的日志文件
自己独立的队列命令

举例：你现在有 3 个站点
api.thingsminder.com（已配置）
site2.com
site3.com

###1、创建新配置文件
```
vi /etc/supervisord.d/site2-worker.conf
```
###2、写入内容（只改 项目路径 + 进程名）
```
[program:site2-worker]   # 这里改个名字，不能重复
process_name=%(program_name)s_%(process_num)02d
command=php /www/wwwroot/site2.com/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www
numprocs=2
redirect_stderr=true
stdout_logfile=/www/wwwroot/site2.com/storage/logs/worker.log
```
###3、保存并加载
```
supervisorctl reread
supervisorctl update
supervisorctl start site2-worker:*
```
###更多站点同理
```
vi /etc/supervisord.d/site3-worker.conf
```
```
[program:site3-worker]
command=php /www/wwwroot/site3.com/artisan queue:work --sleep=3 --tries=3
stdout_logfile=/www/wwwroot/site3.com/storage/logs/worker.log
```
###最终效果
所有站点 互不干扰：
laravel-worker:* → 你的主站
site2-worker:* → 第二个网站
site3-worker:* → 第三个网站

查看所有状态：
```
supervisorctl status
```

###最重要：每个站点必须给权限
每个新项目都必须执行一次：
```
chown -R www:www /www/wwwroot/xxx.com/storage
chmod -R 775 /www/wwwroot/xxx.com/storage
```]]></description>
    <pubDate>Fri, 03 Apr 2026 03:09:48 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/98.html</guid>

</item>
<item>
    <title>git pull 时，每次都会弹出这个合并提交信息的编辑界面，而不是自动完成拉取操作</title>
    <link>https://blog.shzhaoqi.com/other/96.html</link>
    <description><![CDATA[直接拉取并使用默认合并信息
如果你不需要自定义合并提交信息，可以让 Git 自动使用默认信息完成合并：
```
# 单次拉取时使用默认提交信息
git pull --no-edit

# 或者配置 Git 全局默认使用 no-edit，以后所有 pull 都自动完成
git config --global pull.rebase false  # 确保使用 merge 模式（默认）
git config --global core.editor true   # 编辑器直接返回成功，使用默认信息
```]]></description>
    <pubDate>Sat, 28 Feb 2026 08:49:49 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/96.html</guid>

</item>
<item>
    <title>Git 合并时出现 Please enter a commit message to explain why this merge is necessary 问题解决</title>
    <link>https://blog.shzhaoqi.com/other/95.html</link>
    <description><![CDATA[在服务器项目目录执行以下命令：
```
git pull --no-edit
````]]></description>
    <pubDate>Thu, 26 Feb 2026 02:32:29 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/95.html</guid>

</item>
<item>
    <title>禁止 Git 追踪文件权限变更（避免后续再触发冲突）</title>
    <link>https://blog.shzhaoqi.com/other/94.html</link>
    <description><![CDATA[修改 Git 配置，让 Git 忽略文件权限的变更，只追踪文件内容，从根源解决问题：

```
# 进入服务器站点Git目录
cd /www/wwwroot/your-site

# 全局配置（对服务器所有Git仓库生效）
git config --global core.fileMode false

# 或仅对当前站点仓库生效（推荐）
git config core.fileMode false
```
验证配置是否生效：
```
git config core.fileMode  # 输出false则配置成功
```
这样后续在宝塔修改文件权限时，Git 不会再把权限变更识别为 “本地修改”，git pull/git push就不会触发冲突了。]]></description>
    <pubDate>Sat, 21 Feb 2026 04:47:34 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/94.html</guid>

</item>
<item>
    <title>服务器端全局搜索及替换字符串</title>
    <link>https://blog.shzhaoqi.com/other/93.html</link>
    <description><![CDATA[####服务器端全局搜索
```
# 进入前端代码根目录
cd /path/to/frontend

# 全局搜索所有包含旧域名的文件（区分大小写，递归查找）
grep -r "www.qq.cn" ./ --include=*.{html,js,css,json,php,htm}

# 如果想忽略大小写，加 -i 参数
grep -ri "www.qq.cn" ./ --include=*.{html,js,css,json,php,htm}
```
####批量替换旧域名
服务器端批量替换（确认搜索结果无误后执行）
```
# 进入前端代码根目录
cd /path/to/frontend

# 批量替换（将旧域名替换为新域名，递归处理）
sed -i 's/www.qq.cn/www.qq.com/g' $(grep -rl "www.qq.com" ./ --include=*.{html,js,css,json,php,htm})

# 验证替换结果（再次搜索，应无匹配结果）
grep -r "www.qq.cn" ./ --include=*.{html,js,css,json,php,htm}
```]]></description>
    <pubDate>Sat, 31 Jan 2026 02:29:59 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/93.html</guid>

</item>
<item>
    <title>如何批量删除centos指定目录下的所有.DS_Store文件</title>
    <link>https://blog.shzhaoqi.com/other/92.html</link>
    <description><![CDATA[```
find /www/wwwroot/www.sisd-sh.com -name ".DS_Store" -type f -delete
```]]></description>
    <pubDate>Sat, 30 Aug 2025 01:48:21 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/92.html</guid>

</item>
<item>
    <title>PostgresSql中的联表更新（根据一张表的字段更新另一张表）</title>
    <link>https://blog.shzhaoqi.com/other/91.html</link>
    <description><![CDATA[```
update 新表名 set class_name = 旧表表.name from 旧表名 where 新表名.class_id = 旧表表.id;

```]]></description>
    <pubDate>Fri, 11 Jul 2025 15:46:33 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/other/91.html</guid>

</item>
<item>
    <title>pgsql表中查询重复数据</title>
    <link>https://blog.shzhaoqi.com/mysql/90.html</link>
    <description><![CDATA[```
SELECT DISTINCT *
FROM (
    SELECT *, COUNT(*) OVER (PARTITION BY user_name) as cnt
    FROM user_a8
) as subquery
WHERE cnt > 1 ORDER BY user_name;
```]]></description>
    <pubDate>Fri, 11 Jul 2025 14:25:04 +0000</pubDate>
    <author>网络剑客</author>
    <guid>https://blog.shzhaoqi.com/mysql/90.html</guid>

</item></channel>
</rss>