frp简易安装配置说明

一、在有公网IP的服务器上下载frp
cd /opt/
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz
二、安装frp
cd /opt/
tar zxvf frp_0.16.0_linux_amd64.tar.gz
cd frp_0.16.0_linux_amd64
修改 frps.ini 文件(frps_full.ini中是全配置的情况,可以参考配置),设置 http 访问端口为 8084:
# frps.ini 
[common]
bind_port = 7000
vhost_http_port = 8084
vhost_https_port = 443




启动 frps
./frps -c ./frps.ini




三、在内网开发机器上操作
windiws下载:
https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_windows_amd64.zip
Linux下载:
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz


下载完成后解压。


修改 frpc.ini 文件,假设 frps 所在的服务器的 IP 为 x.x.x.x,local_port 为本地机器上 web 服务对应的端口, 绑定自定义域名或者公网IP frpc.yourdomain.com  
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000


[tcp]
type = tcp
local_ip = 127.0.0.1
local_port = 15440
remote_port = 15440


[httpweb]
type = http
local_port = 8084
custom_domains = frpc.yourdomain.com 


[httpsweb]
type = https
local_port = 443
custom_domains = wx.yourdomain.com


启动 frpc
./frpc -c ./frpc.ini




解决微信公众号开发只能是80端口问题:
安装nginx,并域名反向代理如下:
# frpc.conf
server {
        listen       80;
        server_name  frpc.yourdomain.com;


        location / {
                proxy_pass http://frpc.yourdomain.com:8084/;
        }
}




测试验证:
在开发电脑启动端口号为8084的web服务,在浏览器中输入:
http://frpc.yourdomain.com
如果能够正常看到相应页面则表示成功,否则表示不成功。如果不成功则检查相应流程,我这里测试是成功的。



  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冷月宫主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值