Files
gpf_pet_hospital/frp_setup_guide.md

144 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FRP 内网穿透工具安装指南
## 当前状态
- 已安装: frps (服务器端) - 位于 `/mnt/d/bs/gpf_pet_hospital/frp/frps`
- 已安装: frpc (客户端) - 位于 `/mnt/d/bs/gpf_pet_hospital/frp/frpc`
- 版本: FRP 0.66.0 for Linux AMD64
## 方法一:手动下载 (推荐)
### 1. 下载最新版本的FRP
```bash
# 进入项目目录
cd /mnt/d/bs/gpf_pet_hospital
# 下载最新版本的FRP
wget https://github.com/fatedier/frp/releases/download/v0.66.0/frp_0.66.0_linux_amd64.tar.gz
# 解压
tar -xzf frp_0.66.0_linux_amd64.tar.gz
# 将frpc移动到frp目录
mv frp_0.66.0_linux_amd64/frpc frp/
# 清理
rm -rf frp_0.66.0_linux_amd64 frp_0.66.0_linux_amd64.tar.gz
```
### 2. 配置FRPC
创建配置文件 `/mnt/d/bs/gpf_pet_hospital/frp/frpc.ini`:
```ini
[common]
server_addr = 你的公网IP或域名
server_port = 7000
[web]
type = http
local_port = 5173
custom_domains = your-domain.com
[backend]
type = tcp
local_port = 8081
remote_port = 8081
```
## 方法二使用Docker (如果可用)
```bash
# 启动FRPS服务器
docker run -d --name frps \
-p 7000:7000 \
-p 7500:7500 \
-p 8080:80 \
--restart=always \
snowdreamtech/frps:0.50.0
# 启动FRPC客户端
docker run -d --name frpc \
--restart=always \
-v /mnt/d/bs/gpf_pet_hospital/frp/frpc.ini:/etc/frp/frpc.ini \
snowdreamtech/frpc:0.50.0
```
## 方法三:编译安装 (如果有Go环境)
```bash
# 安装Go (如果未安装)
# Ubuntu/Debian: sudo apt-get install golang-go
# 克隆仓库
git clone https://github.com/fatedier/frp.git
cd frp
git checkout v0.66.0
# 编译
make frpc
# 复制到目标位置
cp bin/frpc /mnt/d/bs/gpf_pet_hospital/frp/
```
## 用于宠物医院管理系统的典型配置
### FRPS 服务器配置 (frps.ini)
```ini
[common]
bind_port = 7000
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
vhost_http_port = 80
vhost_https_port = 443
token = your_token_here
```
### FRPC 客户端配置 (frpc.ini)
```ini
[common]
server_addr = 你的公网服务器IP
server_port = 7000
token = your_token_here
[pet-hospital-frontend]
type = http
local_port = 5173
custom_domains = hospital.yourdomain.com
[pet-hospital-backend]
type = tcp
local_port = 8081
remote_port = 8081
[pet-hospital-admin]
type = http
local_port = 5173
custom_domains = admin.yourdomain.com
```
## 启动服务
### 启动FRPS服务器 (在公网服务器)
```bash
cd /mnt/d/bs/gpf_pet_hospital/frp
./frps -c frps.ini
```
### 启动FRPC客户端 (在本地机器)
```bash
cd /mnt/d/bs/gpf_pet_hospital/frp
./frpc -c frpc.ini
```
## 注意事项
1. 确保防火墙开放相应端口 (7000, 80, 443等)
2. 在生产环境中使用强密码和密钥
3. 定期更新FRP版本以获得安全补丁
4. 监控FRP服务的运行状态
## 故障排除
- 检查网络连接
- 确认端口未被占用
- 查看FRP日志文件
- 验证配置文件语法