使用 frp 搭建内网穿透服务器 Web 使用实例
前提准备
- 云服务器一台(或者有公网ip的机器);
- 内网服务器一台;
- Frp脚本文件;
- 域名一个(可选);
- 基本linux操作命令。
在云服务器上搭建服务
1、下载相应的脚本
github地址:github.com/fatedier/frp 下载相应的 Release 版本
查看linux服务器体系结构方法
转至 blog.csdn.net/lixuande19871015/art...
2、安装服务 frps
1、解压 tar -xvf ****.tar.gz
2、配置 vi frps.ini
[common] bind_port = 7000 //frp服务器与客户端同步端口,与客户端要保持一致 vhost_http_port = 8080 // 该端口就是以后访问web服务需要用到的端口
3、运行
./frps -c frps.ini nohup ./frps -c ./frps.ini & // 后台启动
4 、frp后台运行和停止
//运行 nohup ./frps -c frps.ini >/dev/null 2>&1 & //查找服务 ps -aux|grep frp| grep -v grep [1]12345 //kill进程 kill -9 12345
3、配置客户端并运行
- 1、下载相应的 Release
- 2、配置frpc.ini
[common] server_addr = 云服务器ip server_port = 7000 //服务器端口 [web] type = http local_ip = 127.0.0.1 //本地ip local_port = 80 //本地web访问端口 custom_domains = //云服务器ip或者云服务器域名
- 3、 运行
访问内网http服务
custom_domains:vhost_http_port 如:192.168.1.88:8080
注意:
1)服务器端和内网机器端下载的版本要相同,否则可能会影响内网穿透
2)根据服务器系统选择合适的脚本
frp + nginx 配置多人共用的http 内网穿透服务
blog.csdn.net/Aria_Miazzy/article/...
本作品采用《CC 协议》,转载必须注明作者和本文链接