You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# 服务端
|
|
|
|
|
|
|
|
## 官网Releases版本安装
|
|
|
|
|
|
|
|
- 下载最新的[release版本](https://github.com/fatedier/frp/releases)
|
|
|
|
|
|
|
|
```shell
|
|
|
|
wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz
|
|
|
|
```
|
|
|
|
|
|
|
|
- 解压并命重命名
|
|
|
|
|
|
|
|
```shell
|
|
|
|
tar -zxvf frp_0.38.0_darwin_amd64.tar.gz
|
|
|
|
mv frp_0.38.0_darwin_amd64 frp
|
|
|
|
cd frp
|
|
|
|
```
|
|
|
|
|
|
|
|
- 修改服务端配置
|
|
|
|
|
|
|
|
```shell
|
|
|
|
vim frps.ini
|
|
|
|
```
|
|
|
|
|
|
|
|
将以下配置写入文件
|
|
|
|
|
|
|
|
```tex
|
|
|
|
[common]
|
|
|
|
bind_port = 7000
|
|
|
|
# 启用面板
|
|
|
|
dashboard_port = 7001
|
|
|
|
# 面板登录名和密码
|
|
|
|
dashboard_user = mengyxu
|
|
|
|
dashboard_pwd = iaminlove.20.
|
|
|
|
# 使用http代理并使用7002端口进行穿透
|
|
|
|
vhost_http_port = 7002
|
|
|
|
# 使用https代理并使用7003端口进行穿透
|
|
|
|
vhost_https_port = 7003
|
|
|
|
```
|
|
|
|
|
|
|
|
- 启动frp服务端
|
|
|
|
|
|
|
|
```shell
|
|
|
|
./frps -c ./frps.ini
|
|
|
|
```
|
|
|
|
|
|
|
|
## 使用docker安装
|
|
|
|
|
|
|
|
- 拉取镜像
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker pull snowdreamtech/frps
|
|
|
|
```
|
|
|
|
|
|
|
|
- 添加配置文件
|
|
|
|
|
|
|
|
```shell
|
|
|
|
mkdir /home/frp
|
|
|
|
cd /home/frp
|
|
|
|
vim frps.ini
|
|
|
|
```
|
|
|
|
|
|
|
|
配置内容与上面一样
|
|
|
|
|
|
|
|
- 建立容器
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker run --name frps --restart=always -d \
|
|
|
|
-p 7000:7000 \
|
|
|
|
-p 7001:7001 \
|
|
|
|
-p 7002:7002 \
|
|
|
|
-p 7003:7003 \
|
|
|
|
-p 7004:7004 \
|
|
|
|
-p 7005:7005 \
|
|
|
|
-v /home/frp/frps.ini:/etc/frp/frps.ini \
|
|
|
|
snowdreamtech/frps
|
|
|
|
```
|
|
|
|
|
|
|
|
*注意挂载目录与端口映射*
|
|
|
|
|
|
|
|
# 客户端
|
|
|
|
|
|
|
|
|
|
|
|
## 官网Releases版本安装
|
|
|
|
|
|
|
|
- 下载最新的[release版本](https://github.com/fatedier/frp/releases)
|
|
|
|
|
|
|
|
```shell
|
|
|
|
wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz
|
|
|
|
```
|
|
|
|
|
|
|
|
- 解压并命重命名
|
|
|
|
|
|
|
|
```shell
|
|
|
|
tar -zxvf frp_0.38.0_darwin_amd64.tar.gz
|
|
|
|
mv frp_0.38.0_darwin_amd64 frp
|
|
|
|
cd frp
|
|
|
|
```
|
|
|
|
|
|
|
|
- 修改客户端配置文件
|
|
|
|
|
|
|
|
```shell
|
|
|
|
vim frpc.ini
|
|
|
|
```
|
|
|
|
|
|
|
|
```tex
|
|
|
|
[common]
|
|
|
|
server_addr = 114.132.229.108
|
|
|
|
server_port = 7000
|
|
|
|
|
|
|
|
[11-ssh]
|
|
|
|
type = tcp
|
|
|
|
local_ip = 10.100.0.221
|
|
|
|
local_port = 1122
|
|
|
|
remote_port = 7004
|
|
|
|
|
|
|
|
[11-mysql]
|
|
|
|
type = tcp
|
|
|
|
local_ip = 10.100.0.221
|
|
|
|
local_port = 11306
|
|
|
|
remote_port = 7005
|
|
|
|
|
|
|
|
[masterlab]
|
|
|
|
type = http
|
|
|
|
local_ip = 10.100.0.221
|
|
|
|
local_port = 1181
|
|
|
|
custom_domains = master.xumy.vip
|
|
|
|
```
|
|
|
|
|
|
|
|
[frp客户端的详细配置说明](https://gofrp.org/docs/reference/client-configures/)
|
|
|
|
|
|
|
|
- 启动`frp`客户端
|
|
|
|
|
|
|
|
```shell
|
|
|
|
./frpc -c ./frpc.ini
|
|
|
|
|
|
|
|
nohup ./frpc -c ./frpc.ini >./frpc.log 2>&1 &
|
|
|
|
```
|
|
|
|
|
|
|
|
## 使用docker安装
|
|
|
|
|
|
|
|
- 拉取镜像
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker pull snowdreamtech/frpc
|
|
|
|
```
|
|
|
|
|
|
|
|
- 创建配置文件
|
|
|
|
|
|
|
|
```shell
|
|
|
|
mkdir /home/frp
|
|
|
|
cd /home/frp
|
|
|
|
vim frpc.ini
|
|
|
|
```
|
|
|
|
|
|
|
|
配置比较麻烦,不建议用docker装
|
|
|
|
|
|
|
|
- 创建容器
|
|
|
|
|