修改端口
This commit is contained in:
@@ -39,10 +39,10 @@ chart-label-tool/
|
||||
|
||||
```bash
|
||||
cd public
|
||||
python3 -m http.server 8080
|
||||
python3 -m http.server 8010
|
||||
```
|
||||
|
||||
浏览器访问:<http://localhost:8080>
|
||||
浏览器访问:<http://localhost:8010>
|
||||
|
||||
## 服务器部署(Ubuntu / 局域网)
|
||||
|
||||
@@ -54,7 +54,7 @@ cd /opt/chart-label-tool
|
||||
sudo bash deploy/install.sh
|
||||
```
|
||||
|
||||
局域网访问:`http://<服务器IP>:8080`
|
||||
局域网访问:`http://<服务器IP>:8010`
|
||||
|
||||
## 使用说明
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
name: "chart-label-tool",
|
||||
cwd: "/opt/chart-label-tool",
|
||||
script: "/opt/chart-label-tool/venv/bin/python",
|
||||
args: "-m http.server 8080 --bind 0.0.0.0 --directory /opt/chart-label-tool/public",
|
||||
args: "-m http.server 8010 --bind 0.0.0.0 --directory /opt/chart-label-tool/public",
|
||||
interpreter: "none",
|
||||
autorestart: true,
|
||||
watch: false,
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ set -euo pipefail
|
||||
|
||||
APP_DIR="/opt/chart-label-tool"
|
||||
REPO_URL="https://git.bz121.com/dekun/chart-label-tool.git"
|
||||
PORT=8080
|
||||
PORT=8010
|
||||
SERVICE_USER="root"
|
||||
|
||||
echo "==> K线点位标注工具 部署开始"
|
||||
|
||||
+10
-10
@@ -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 拉取失败
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
## 访问地址
|
||||
|
||||
- **局域网部署**:`http://<服务器IP>:8080`
|
||||
- **本机调试**:`http://localhost:8080`
|
||||
- **局域网部署**:`http://<服务器IP>:8010`
|
||||
- **本机调试**:`http://localhost:8010`
|
||||
|
||||
推荐使用 **Chrome** 或 **Edge** 浏览器。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user