修改端口

This commit is contained in:
dekun
2026-05-27 14:23:47 +08:00
parent 62bd58d2c4
commit 95b55e41f3
5 changed files with 17 additions and 17 deletions
+10 -10
View File
@@ -15,7 +15,7 @@
```
浏览器 (局域网)
↓ HTTP :8080
↓ HTTP :8010
PM2 → Python venv → http.server
↓ 静态文件
/opt/chart-label-tool/public/
@@ -42,13 +42,13 @@ sudo bash deploy/install.sh
2. 安装 Node.js 与 PM2(若未安装)
3. 克隆/更新代码到 `/opt/chart-label-tool`
4. 创建 Python 虚拟环境 `venv/`
5. 使用 PM2 启动 `chart-label-tool` 进程(监听 `0.0.0.0:8080`
5. 使用 PM2 启动 `chart-label-tool` 进程(监听 `0.0.0.0:8010`
6. 执行 `pm2 save``pm2 startup`(开机自启)
部署成功后,在局域网内任意电脑浏览器访问:
```text
http://<服务器局域网IP>:8080
http://<服务器局域网IP>:8010
```
查看本机 IP
@@ -104,17 +104,17 @@ sudo pm2 startup
```bash
pm2 status
curl -I http://127.0.0.1:8080
curl -I http://127.0.0.1:8010
```
浏览器打开 `http://<服务器IP>:8080`,应能看到标注工具页面。
浏览器打开 `http://<服务器IP>:8010`,应能看到标注工具页面。
## 防火墙
若启用了 UFW,需放行 8080 端口:
若启用了 UFW,需放行 8010 端口:
```bash
sudo ufw allow 8080/tcp
sudo ufw allow 8010/tcp
sudo ufw reload
```
@@ -147,9 +147,9 @@ pm2 restart chart-label-tool
### 页面无法打开
1. `pm2 status` 确认进程为 `online`
2. `ss -tlnp | grep 8080` 确认端口在监听
2. `ss -tlnp | grep 8010` 确认端口在监听
3. 检查服务器与客户端是否同一局域网
4. 检查防火墙是否放行 8080
4. 检查防火墙是否放行 8010
### PM2 启动失败
@@ -166,7 +166,7 @@ ls -la /opt/chart-label-tool/venv/bin/python
手动测试:
```bash
/opt/chart-label-tool/venv/bin/python -m http.server 8080 --bind 0.0.0.0 --directory /opt/chart-label-tool/public
/opt/chart-label-tool/venv/bin/python -m http.server 8010 --bind 0.0.0.0 --directory /opt/chart-label-tool/public
```
### Git 拉取失败