Ubuntu 搭建 frp

必要条件

需要有固定IP的外网服务器

下载

# 最新版下载地址
https://github.com/fatedier/frp/releases

# Ubuntu 服务器下载文件
https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz

# Windows
https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_windows_amd64.zip

服务器-安装

下载文件

wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz

解压文件

tar zxvf frp_0.44.0_linux_amd64.tar.gz

进入到文件目录

cd frp_0.44.0_linux_amd64

编辑服务器配置文件

vim frps.ini

编辑内容:

[common]
bind_port = 7000
vhost_http_port = 8000 

服务器-启动服务

# 测试启动
./frps -c ./frps.ini

# 后台启动
nohup ./frps -c ./frps.ini > logs.out 2>1 &

# 查询启动任务ID
ps -ef | grep frps

# 杀死进程
kill -9 进程ID

客户端-Win11-安装

使用 Windows 客户端连接

  1. 解压window 客户端 frp_0.44.0_windows_amd64.zip
  2. 修改配置文件 frpc.ini
[common]
# 服务器地址
server_addr = xxx.xxx.xxx.xxx
# 服务器端口
server_port = 7000

[web01]
# 服务类型
type = http
# 本机IP
local_ip = 127.0.0.1
# 本机端口
local_port = 8000
# 访问地址可以配置域名, 也可以配置IP, 配置域名. 需要域名IP指向服务器. 配置IP则和服务器IP相同
custom_domains = xxx.xxx.xxx.xxx

常用配置

服务器配置 frps.ini

[common]
bind_port = 7000
vhost_http_port = 8000 

客户端配置 frpc.ini

# 服务类型
type = http
# 本机IP
local_ip = 127.0.0.1
# 本机端口
local_port = 8000
# 访问地址可以配置域名, 也可以配置IP, 配置域名. 需要域名IP指向服务器. 配置IP则和服务器IP相同
custom_domains = xxx.xxx.xxx.xxx
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值