FRP服务搭建
- 远程登录服务器,下载源码(以最新版为例)
https://github.com/fatedier/frp/releases/download/v0.35.0/frp_0.35.0_linux_amd64.tar.gz
- 解压并写配置文件
并按照配置要求开放防火墙端口(此处为7000)
- 设置开机启动
添加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
ps aux | grep frps ##查看frp是否启动
- 客户端配置
[common]
server_addr = 服务器IP
server_port = 7000
[http]
type = tcp
local_ip = 本机IP
local_port = 80
remote_port = 80
- 配置完毕
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭