frp服务器配置方法

frp下载:下载地址:https://github.com/fatedier/frp/releasesicon-default.png?t=N7T8https://github.com/fatedier/frp/releases

提供windows和linux各版本的安装包,选择和系统合适的版本下载。

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

解压:

tar -zxvf frp_0.42.0_linux_amd64.tar.gz

将解压文件改名字放到/etc/目录下

cp -r frp_0.42.0_linux_amd64 frps

cd /etc/frps

ls

frps
frps.ini
frpc
frpc.ini

frps和frps.ini是服务端文件

frpc和frpc.ini是客户端文件

如果只做服务器,可以删除frpc和frpc.ini

配置frps.ini

vi frps.ini

[common]
bind_port = 7000 --frps链接端口
dashboard_port = 7500    --frps面板的地址
token = 41f1a553fd725468436eeac92425285f9accbd --令牌:链接密码
dashboard_user = root  ---frps面板的用户名

dashboard_pwd = admin  ---frps面板的密码

启动frps服务:

./frps -c frps.ini

后台运行frps:

nohup ./frps -c frps.ini &

路由器映射放行7000和7500端口:

查看后台面板:ip:7500

做web映射需要的参数:

vhost_http_port = 7001  --http端口
vhost_https_port = 7003  --https端口
authentication_timeout = 0
subdomain_host =
privilege_mode = true

客户端设置

用文本编辑器打开frpc.ini,与服务端类似,内容如下

[common]
server_addr = 你的服务器ip
server_port = 7000
token = 41f1a553fd725468436eeac92425285f9
[web1]
type = tcp
local_port = 80
local_ip = 127.0.0.1
remote_port = 7001
[web2]
type = tcp
local_port = 443
local_ip = 127.0.0.1
remote_port = 7003

启动frp:

./frpc -c frpc.ini

需要地的可以私信作者。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值