V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
accgcc233
V2EX  ›  VPS

利用腾讯轻量服务器搭建 FRP 服务

  •  
  •   accgcc233 · 2021-01-25 09:29:54 +08:00 · 479 次点击
    这是一个创建于 1214 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在如今这个 IPV4 缺乏的年代,家庭宽带获取到公网 IPV4 相对比较困难,特别是移动用户,基本上就是默认不给公网 IPV4,这时候,如果我们想要把内网的资源映射到公网上去,可能会需要用到内网穿透。而 FRP 就是提供这种服务的一种工具废话少说,现在开始进入正题。

    1. 腾讯轻量服务器购买 对于预算较低的用户,香港地区 24 的轻量还是非常推荐的

    这边我们选择系统镜像,我们以 centos8 为例。 2. 在腾讯云防火墙开启相应端口(以映射 web 服务为例,开启 80 端口,默认已经开启)

    1. 远程登录服务器,下载源码(以最新版为例) https://github.com/fatedier/frp/releases/download/v0.35.0/frp_0.35.0_linux_amd64.tar.gz

    2. 解压并写配置文件

    并按照配置要求开放防火墙端口(此处为 7000 ) 5. 设置开机启动 添加 systemd 配置文件: vim /usr/lib/systemd/system/frp.service 文件内容如下:

    [Unit] Description=The nginx HTTP and reverse proxy server After=network.target remote-fs.target nss-lookup.target

    [Service] Type=simple ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true StandardOutput=syslog StandardError=inherit

    [Install] WantedBy=multi-user.target ExecStart 的内容请根据自己 frp 安装目录修改。

    设置开机启动 systemctl daemon-reload systemctl enable frp 启动 frp systemctl start frp 查看 frp 是否启动 ps aux | grep frps 6. 客户端配置 [common] server_addr = 服务器 IP server_port = 7000

    [http] type = tcp local_ip = 本机 IP local_port = 80 remote_port = 80 7. 配置完成,尽情享用

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2980 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:34 · PVG 19:34 · LAX 04:34 · JFK 07:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.