410的debian部署代理,FreeLLMAPI添加Gemini教程

适用于:树莓派、小型 VPS、OpenWrt 路由等 512MB 内存以下设备
设备:Debian 12, aarch64, 460MB 可用内存, 8GB 存储


架构总览

1
2
[互联网] ←→ [Mihomo 代理] ←→ [FreeLLMAPI] ←→ [Gemini / DeepSeek / 其他 LLM]
127.0.0.1:7890 127.0.0.1:3001

第一步:创建 Swap(虚拟内存)

512MB 物理内存不够用,必须用硬盘换内存:

1
2
3
4
5
6
7
8
9
10
11
12
# 创建 2GB Swap 文件,(空间不够,1G也可以)
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# 开机自动启用
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# 调整 Swappiness(更积极使用 Swap)
echo 'vm.swappiness=60' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

第二步:安装 Mihomo 内核

不用 Docker(太吃内存),直接下二进制:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 确定架构
uname -d # aarch64 / x86_64 / armv7l

# 下载对应版本(示例:arm64)
curl -L --max-time 600 -o /tmp/mihomo.gz \
"https://ghproxy.net/https://github.com/MetaCubeX/mihomo/releases/download/v1.19.28/mihomo-linux-arm64-v1.19.28.gz"

# 解压安装
gunzip -f /tmp/mihomo.gz
sudo mv /tmp/mihomo /usr/local/bin/mihomo
sudo chmod +x /usr/local/bin/mihomo

# 验证
mihomo -v

加速说明:中国大陆连 GitHub 极慢,推荐使用 ghproxy.net 镜像加速。


第三步:配置 Mihomo(含订阅)

1
2
mkdir -p ~/.config/mihomo/proxy_providers
nano ~/.config/mihomo/config.yaml

写入以下配置:

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
# 代理端口(HTTP + SOCKS5 共用)
mixed-port: 7890
# API 端口(用于管理)
external-controller: 127.0.0.1:9090
# 不允许局域网(仅本机使用)
allow-lan: false
mode: rule
log-level: warning

# 配置文件持久化
profile:
store-selected: true
store-fake-ip: true

ipv6: false

# DNS 配置(防止 DNS 投毒)
dns:
enable: true
listen: 0.0.0.0:1053
default-nameserver:
- 223.5.5.5
- 119.29.29.29
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
fake-ip: true
prefer-h3: false
nameserver-policy:
"geosite:cn": "223.5.5.5"
"+.xn--cp3a08l.com": "223.5.5.5"
"+.xn--ghqu5fm27b67w.com": "223.5.5.5"
"+.xn--ghq880n3na965a.com": "223.5.5.5"
"+.yydjc.top": "223.5.5.5"

# 远程订阅
proxy-providers:
my-sub:
type: http
url: "https://你的订阅地址"
interval: 3600
path: ./proxy_providers/my-sub.yaml
health-check:
enable: true
interval: 600
url: http://www.gstatic.com/generate_204

# 代理组
proxy-groups:
- name: "PROXY"
type: select
proxies:
- 自动选择
- DIRECT
use:
- my-sub
- name: "自动选择"
type: url-test
use:
- my-sub
url: http://www.gstatic.com/generate_204
interval: 600
tolerance: 50

# 路由规则
rules:
- GEOIP,CN,DIRECT
- MATCH,PROXY

关键nameserver-policy 列表中的域名是订阅服务器和节点服务器的域名,确保它们用国内 DNS 解析,避免解析失败。


第四步:创建 Systemd 服务

1
sudo nano /etc/systemd/system/mihomo.service

写入:

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=mihomo Daemon
After=network.target

[Service]
Environment="GOMEMLIMIT=150MiB"
Environment="GOGC=50"
ExecStart=/usr/local/bin/mihomo -d /root/.config/mihomo/
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
  • GOMEMLIMIT=150MiB:强制内存不超过 150MB
  • GOGC=50:更积极的垃圾回收,节省内存

启动并设为开机自启:

1
2
3
4
sudo systemctl daemon-reload
sudo systemctl enable mihomo
sudo systemctl start mihomo
sudo systemctl status mihomo

第五步:验证代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 检查端口
ss -tlnp | grep 7890

# 检查内存
ps -o pid,rss,comm -p $(pgrep mihomo)
# 期望:RSS 约 40-60MB

# 测试代理
curl -x http://127.0.0.1:7890 -sS -o /dev/null -w "HTTP: %{http_code}\nTime: %{time_total}s\n" https://www.google.com
# 期望:HTTP 200 或 302

# 测试 GitHub
curl -x http://127.0.0.1:7890 -sS -o /dev/null -w "HTTP: %{http_code}\n" https://github.com
# 期望:HTTP 200

第六步:配置 FreeLLMAPI 使用代理

FreeLLMAPI 支持通过数据库配置代理。

6.1 找到数据库文件

1
2
find /opt/freellmapi -name "*.db" 2>/dev/null
# 通常在:/opt/freellmapi/server/data/freeapi.db

6.2 写入代理配置

1
2
sqlite3 /opt/freellmapi/server/data/freeapi.db \
"INSERT OR REPLACE INTO settings (key, value) VALUES ('proxy_url', 'http://127.0.0.1:7890');"

6.3 重启 FreeLLMAPI

1
2
sudo systemctl restart freellmapi
sudo journalctl -u freellmapi --no-pager -n 10

期望看到:[proxy] Configured → http://127.0.0.1:7890


第七步:添加 Google API Key

7.1 获取 API Key

  1. 访问 https://aistudio.google.com/api-keys
  2. 创建或复制你的 API Key(格式:AIzaSy...

7.2 通过 FreeLLMAPI Dashboard 添加

  1. 浏览器打开 http://设备IP:3001
  2. 进入 Settings → API Keys
  3. 点击 Add Key
  4. Platform 选择 google
  5. 粘贴 API Key
  6. 保存

7.3 验证

1
2
3
4
5
# 测试 Gemini 模型
curl -s http://127.0.0.1:3001/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 你的freellmapi-key" \
-d '{"model":"gemini-3.5-flash","messages":[{"role":"user","content":"say hi"}],"max_tokens":10}'

第八步:可用模型列表

✅ 可用的 Google 模型

模型 速度 特点
gemini-3.5-flash 6-7s 最新可用,推荐
gemma-4-31b-it 1-2s 免费额度 15 RPM / 1000 RPD

❌ 不可用的模型

模型 原因
gemini-2.5-flash Google 说”新用户不可用”
gemini-2.5-flash-lite 同上

说明:Google 对”新用户”限制了旧版 Flash 模型。如需使用,需在 Google Cloud Console 中提升账号等级或使用老账号的 key。


常见问题

Q: 代理连接失败 / DNS 超时

症状curl: (35) SSL_ERROR_SYSCALLcontext deadline exceeded

解决

  1. 检查 DNS 配置:nameserver-policy 中是否包含订阅域名
  2. 检查代理是否运行:systemctl status mihomo
  3. 检查端口:ss -tlnp | grep 7890

Q: 订阅下载失败

症状[Provider] my-sub pull error: EOFTLS handshake timeout

解决

  1. 确保 nameserver-policy 包含订阅域名
  2. 手动测试:curl -x http://127.0.0.1:7890 "https://订阅地址"
  3. 检查订阅是否过期

Q: FreeLLMAPI 启动失败

症状Failed to locate executable /usr/bin/node

解决

1
2
3
4
5
6
7
8
9
10
# 重装 Node.js 22.x
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
sudo apt-get install -y nodejs
sudo ln -sf $(command -v node) /usr/bin/node

# 重建 native 模块
cd /opt/freellmapi && npm rebuild better-sqlite3

# 重启
sudo systemctl restart freellmapi

Q: Gemini 返回 404 model_not_found

症状Google API error 404: This model is no longer available to new users

解决

  • 使用 gemini-3.5-flash 替代 gemini-2.5-flash
  • 或使用 gemma-4-31b-it(免费)

Q: 内存不足(OOM)

症状:进程被 kill,dmesg | grep -i oom

解决

  1. 确认 Swap 已启用:free -m
  2. 降低 GOMEMLIMIT:编辑 /etc/systemd/system/mihomo.service,改为 100MiB
  3. 关闭不必要的服务:sudo systemctl disable bluetooth cups

管理命令速查

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Mihomo
systemctl status mihomo # 状态
systemctl restart mihomo # 重启
journalctl -u mihomo -f # 实时日志

# FreeLLMAPI
systemctl status freellmapi # 状态
systemctl restart freellmapi # 重启
journalctl -u freellmapi -f # 实时日志

# 查看内存
free -m
ps -o pid,rss,comm -p $(pgrep -d"," mihomo,node)

# 切换代理节点(通过 API)
curl -s http://127.0.0.1:9090/proxies/PROXY | python3 -m json.tool

内存预算

进程 内存占用
Mihomo 50-70MB
FreeLLMAPI (Node.js) 80-100MB
系统基础 ~150MB
总计 ~280MB
剩余 ~180MB

总结

  1. Swap 必须开:512MB 物理内存不够,用硬盘补
  2. Mihomo 替代 Clash Verge:纯命令行,不吃内存
  3. 订阅用 proxy-providers:自动更新节点列表
  4. DNS 防投毒fake-ip: true + nameserver-policy
  5. FreeLLMAPI 配代理:DB 写入 proxy_url
  6. Gemini 用 3.5-flash:2.5 系列对新用户已下线

第九步:部署 mihomo 代理控制面板(浏览器一键管理)

在浏览器中启动、停止、重启、修改配置 mihomo 代理,无需 SSH 终端。
同时自动同步 FreeLLMAPI 代理设置:停 mihomo 时 FreeLLMAPI 自动直连外网,启动时自动走代理。

9.1 部署脚本

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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# 安装 Python3(通常已预装)
apt install python3 -y

# 部署控制面板
cat > /opt/mihomo_panel.py << 'PYEOF'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import http.server, socketserver, subprocess, json, base64, sys

PORT = 8099
USER = "admin"
PASS = "223admin"
CONFIG_PATH = "/root/.config/mihomo/config.yaml"
MIHOMO_SERVICE = "mihomo"
AUTH = "Basic " + base64.b64encode(f"{USER}:{PASS}".encode()).decode()

HTML = '''<!DOCTYPE html><html lang=zh-CN><head><meta charset=UTF-8>
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>mihomo 代理控制</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#0d1117;color:#c9d1d9;min-height:100vh}
.header{padding:16px;background:#161b22;border-bottom:1px solid #30363d;position:sticky;top:0;z-index:10}
.header h1{font-size:18px;color:#58a6ff;margin-bottom:4px}
.header .status{font-size:13px;color:#8b949e}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}
.dot.green{background:#3fb950;box-shadow:0 0 6px #3fb950}
.dot.red{background:#f85149}
.container{padding:12px;max-width:600px;margin:0 auto}
.card{background:#161b22;border:1px solid #30363d;border-radius:10px;margin-bottom:12px;overflow:hidden}
.card-title{padding:10px 14px;font:600 13px/1 sans-serif;color:#8b949e;background:#0d1117;border-bottom:1px solid #30363d}
.card-body{padding:14px}
.btn{display:block;width:100%;padding:14px;margin-bottom:8px;border:none;border-radius:8px;font-size:15px;font-weight:600;cursor:pointer;transition:.15s}
.btn:active{transform:scale(.97)}
.btn-green{background:#238636;color:#fff}
.btn-red{background:#da3633;color:#fff}
.btn-orange{background:#d29922;color:#000}
.btn-gray{background:#21262d;color:#c9d1d9;border:1px solid #30363d}
.btn-row{display:flex;gap:8px}
.btn-row .btn{margin-bottom:0}
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
.info-item{background:#0d1117;border-radius:6px;padding:10px}
.info-item .label{font-size:11px;color:#8b949e;margin-bottom:4px}
.info-item .value{font-size:14px;font-weight:600;color:#f0f6fc;font-family:monospace}
textarea{width:100%;height:280px;background:#0d1117;border:1px solid #30363d;border-radius:6px;color:#c9d1d9;font-family:monospace;font-size:12px;padding:12px;resize:vertical}
.save-row{display:flex;gap:8px;margin-top:8px}
.save-row .btn{margin-bottom:0}
.log-box{width:100%;height:120px;background:#0d1117;border:1px solid #30363d;border-radius:6px;color:#8b949e;font-family:monospace;font-size:11px;padding:10px;overflow-y:auto;margin-bottom:8px;white-space:pre-wrap}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#238636;color:#fff;padding:10px 20px;border-radius:8px;font-size:14px;z-index:100;opacity:0;transition:.3s;pointer-events:none}
.toast.show{opacity:1}
.toast.err{background:#da3633}
</style></head>
<body>
<div class="header">
<h1>mihomo 代理控制</h1>
<div class="status"><span class="dot" id="statusDot"></span><span id="statusText">检测中...</span></div>
</div>
<div class="container">
<div class="card">
<div class="card-title">服务控制</div>
<div class="card-body">
<div class="btn-row">
<button class="btn btn-green" onclick="action('start')">启动</button>
<button class="btn btn-red" onclick="action('stop')">停止</button>
</div>
<button class="btn btn-orange" onclick="action('restart')">重启 mihomo</button>
<button class="btn btn-gray" onclick="action('reboot')">重启服务器</button>
</div>
</div>
<div class="card">
<div class="card-title">运行状态</div>
<div class="card-body">
<div class="info-grid">
<div class="info-item"><div class="label">代理端口</div><div class="value">7890</div></div>
<div class="info-item"><div class="label">DNS端口</div><div class="value">1053</div></div>
<div class="info-item"><div class="label">控制端口</div><div class="value">9090</div></div>
<div class="info-item"><div class="label">面板端口</div><div class="value">8099</div></div>
</div>
</div>
</div>
<div class="card">
<div class="card-title">配置编辑</div>
<div class="card-body">
<textarea id="config"></textarea>
<div class="save-row">
<button class="btn btn-green" onclick="saveConfig()">保存并重启</button>
<button class="btn btn-gray" onclick="loadConfig()">重新加载</button>
</div>
</div>
</div>
<div class="card">
<div class="card-title">日志</div>
<div class="card-body">
<div class="log-box" id="logBox">点击加载日志</div>
<button class="btn btn-gray" onclick="loadLog()">加载日志</button>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
var H={"Content-Type":"application/json","Authorization":"AUTH_PLACEHOLDER"};
function $(i){return document.getElementById(i)}
function toast(m,e){
var t=$("toast");t.textContent=m;t.className="toast show"+(e?" err":"");
setTimeout(function(){t.className="toast"},3000)
}
async function action(c){
if(c==="reboot"&&!confirm("确定重启服务器?"))return;
var r=await fetch("/api/"+c,{method:"POST",headers:H});
var d=await r.json();
toast(d.ok?d.msg:"失败:"+(d.msg||"未知错误"),!d.ok);
setTimeout(checkStatus,1500);
}
async function checkStatus(){
try{
var r=await fetch("/api/status",{headers:H});
var d=await r.json();
$("statusDot").className=d.active?"dot green":"dot red";
$("statusText").textContent=d.active?"运行中 PID "+d.pid:"已停止";
}catch(e){}
}
async function loadConfig(){
try{
var d=await(await fetch("/api/config",{headers:H})).json();
$("config").value=d.content||"";
}catch(e){toast("加载失败",1)}
}
async function saveConfig(){
var c=$("config").value;
try{
var d=await(await fetch("/api/config",{method:"POST",headers:H,body:JSON.stringify({content:c})})).json();
toast(d.ok?"保存成功并已重启":"保存失败",!d.ok);
}catch(e){toast("保存失败",1)}
}
async function loadLog(){
try{
var d=await(await fetch("/api/log",{headers:H})).json();
$("logBox").textContent=d.content||"无日志";
}catch(e){toast("日志加载失败",1)}
}
checkStatus();loadConfig();
</script>
</body></html>'''.replace("AUTH_PLACEHOLDER", AUTH)


def run_cmd(cmd, timeout=15):
try:
r = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=timeout)
return {"ok": r.returncode == 0, "msg": r.stdout.strip() or r.stderr.strip()}
except:
return {"ok": False, "msg": "命令执行失败"}


def set_freellmapi_proxy(proxy_url):
"""自动同步 FreeLLMAPI 代理设置(启动mihomo时设代理,停止时清空直连)"""
try:
import sqlite3
db = "/opt/freellmapi/server/data/freeapi.db"
conn = sqlite3.connect(db)
cur = conn.cursor()
cur.execute("UPDATE settings SET value=? WHERE key='proxy_url'", (proxy_url,))
if cur.rowcount == 0:
cur.execute("INSERT INTO settings (key, value) VALUES ('proxy_url', ?)", (proxy_url,))
conn.commit()
conn.close()
subprocess.run("systemctl restart freellmapi", shell=True, capture_output=True, timeout=15)
return True
except:
return False


def get_mihomo_status():
r = run_cmd(f"systemctl is-active {MIHOMO_SERVICE}")
active = r["ok"] and r["msg"] == "active"
pid_r = run_cmd(f"systemctl show -p MainPID --value {MIHOMO_SERVICE}")
pid = pid_r.get("msg", "0").strip()
return {"active": active, "pid": pid}


class Handler(http.server.BaseHTTPRequestHandler):
def check_auth(self):
if self.headers.get("Authorization", "") != AUTH:
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.end_headers()
self.wfile.write(b"<html><body><h1>403</h1></body></html>")
return False
return True

def do_GET(self):
if self.path in ["/", "/index.html"]:
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.end_headers()
self.wfile.write(HTML.encode("utf-8"))
elif self.path == "/api/status":
self.json_response(get_mihomo_status())
elif self.path == "/api/config":
try:
with open(CONFIG_PATH, "r") as f:
self.json_response({"ok": True, "content": f.read()})
except Exception as e:
self.json_response({"ok": False, "msg": str(e)})
elif self.path == "/api/log":
r = run_cmd(f"journalctl -u {MIHOMO_SERVICE} --no-pager -n 30 --output=cat")
self.json_response({"ok": r["ok"], "content": r["msg"]})
else:
self.send_response(404)
self.end_headers()

def do_POST(self):
length = int(self.headers.get("Content-Length", 0))
body = self.wfile.read(length).decode() if length else "{}"

if self.path == "/api/start":
r = run_cmd(f"systemctl start {MIHOMO_SERVICE}")
if r["ok"]:
set_freellmapi_proxy("http://127.0.0.1:7890")
self.json_response({"ok": r["ok"], "msg": "mihomo 已启动,代理已设置" if r["ok"] else r["msg"]})
elif self.path == "/api/stop":
r = run_cmd(f"systemctl stop {MIHOMO_SERVICE}")
if r["ok"]:
set_freellmapi_proxy("")
self.json_response({"ok": r["ok"], "msg": "mihomo 已停止,已切换直连" if r["ok"] else r["msg"]})
elif self.path == "/api/restart":
r = run_cmd(f"systemctl restart {MIHOMO_SERVICE}")
if r["ok"]:
set_freellmapi_proxy("http://127.0.0.1:7890")
self.json_response({"ok": r["ok"], "msg": "mihomo 已重启,代理已恢复" if r["ok"] else r["msg"]})
elif self.path == "/api/reboot":
run_cmd("nohup sh -c 'sleep 2 && reboot' >/dev/null 2>&1 &")
self.json_response({"ok": True, "msg": "服务器正在重启..."})
elif self.path == "/api/config":
try:
data = json.loads(body)
with open(CONFIG_PATH, "w") as f:
f.write(data.get("content", ""))
r = run_cmd(f"systemctl restart {MIHOMO_SERVICE}")
self.json_response({"ok": r["ok"], "msg": "配置已保存并重启" if r["ok"] else r["msg"]})
except Exception as e:
self.json_response({"ok": False, "msg": str(e)})
else:
self.send_response(404)
self.end_headers()

def json_response(self, data):
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(json.dumps(data).encode())

def log_message(self, *args):
pass


class ReusableTCPServer(socketserver.TCPServer):
allow_reuse_address = True


if __name__ == "__main__":
port = int(sys.argv[1]) if len(sys.argv) > 1 else PORT
with ReusableTCPServer(("0.0.0.0", port), Handler) as httpd:
print(f"Panel on :{port}", flush=True)
try:
httpd.serve_forever()
except KeyboardInterrupt:
pass
PYEOF

9.2 创建 systemd 服务(开机自启 + 崩溃自动重启)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cat > /etc/systemd/system/mihomo-panel.service << 'EOF'
[Unit]
Description=mihomo control panel
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/mihomo_panel.py 8099
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable --now mihomo-panel.service

9.3 功能说明

按钮 效果
启动 启动 mihomo + FreeLLMAPI 通过代理(7890)访问外网
停止 停止 mihomo + FreeLLMAPI 自动切换直连外网
重启 mihomo 重启 mihomo + FreeLLMAPI 恢复代理
重启服务器 reboot(有二次确认弹窗)
配置编辑 在线编辑 /root/.config/mihomo/config.yaml,保存后自动重启 mihomo
加载日志 查看最近 30 行 journalctl 日志

浏览器打开 http://设备IP:8099,无登录弹窗,打开即用。

9.4 服务管理命令

1
2
3
4
5
6
7
8
9
# 查看状态
systemctl status mihomo-panel.service

# 停止 / 重启
systemctl stop mihomo-panel.service
systemctl restart mihomo-panel.service

# 查看日志
journalctl -u mihomo-panel.service -f