V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
accgcc233
V2EX  ›  VPS

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

  •  
  •   accgcc233 · Jan 25, 2021 · 1161 views
    This topic created in 1922 days ago, the information mentioned may be changed or developed.

    在如今这个 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. 配置完成,尽情享用

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2455 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 05:14 · PVG 13:14 · LAX 22:14 · JFK 01:14
    ♥ Do have faith in what you're doing.