Created
March 2, 2021 06:20
-
-
Save xiaoysh8/ffca6fea7d5b3b557b084d2f55981fc7 to your computer and use it in GitHub Desktop.
frp安装和使用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| frp安装和使用 | |
| 前提 | |
| 有一台有公网ip的或者固定域名的服务器(腾讯云/阿里云/百度云/Vultr等) | |
| 一.安装frp | |
| frp官方下载: | |
| https://github.com/fatedier/frp/releases | |
| 解压 | |
| tar -zxvf frp_0.32.1_linux_amd64.tar.gz | |
| 1 | |
| 注:服务器和pc都是安装这个,只是用的配置文件不同。(网速慢下载不了的上面有,仅供64位系统) | |
| 二.配置服务端(服务器) | |
| 进入文件夹: | |
| cd frp_0.32.1_linux_amd64 | |
| 1 | |
| 编辑配置文件: | |
| vi ./frps.ini | |
| 1 | |
| [common] | |
| bind_port = 7000 #与客户端绑定的进行通信的端口 | |
| vhost_http_port = 6081 #访问客户端web服务自定义的端口号 | |
| 1 | |
| 2 | |
| 3 | |
| 保存然后启动服务 | |
| ./frps -c ./frps.ini | |
| 1 | |
| 后台启动命令为 | |
| nohup ./frps -c ./frps.ini & | |
| 1 | |
| 三.配置客户端(pc) | |
| vi ./frpc.ini | |
| 1 | |
| [common] | |
| server_addr = 120.56.37.48 #公网服务器ip | |
| server_port = 7000 #与服务端bind_port一致 | |
| #公网通过ssh访问内部服务器 | |
| [ssh] | |
| type = tcp #连接协议 | |
| local_ip = 192.168.1.108 #内网服务器ip | |
| local_port = 22 #ssh默认端口号 | |
| remote_port = 8000 #自定义的访问内部ssh端口号 | |
| #公网访问内部web服务器以http方式 | |
| [web] | |
| type = http #访问协议 | |
| local_port = 8081 #内网web服务的端口号 | |
| custom_domains = repo.iwi.com #所绑定的公网服务器域名,一级、二级域名都可以 | |
| 保存然后执行启动服务 | |
| ./frpc -c ./frpc.ini | |
| 1 | |
| 后台启动命令为 | |
| nohup ./frpc -c ./frpc.ini & | |
| 1 | |
| 温馨提示:服务器要放行相关端口,而且腾讯云,阿里云等要在安全组放行端口 | |
| ———————————————— | |
| 版权声明:本文为CSDN博主「LingMessy」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 | |
| 原文链接:https://blog.csdn.net/weixin_44823747/article/details/105414284 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment