内网穿透工具 FRP

发布于 2022-01-23  5 次阅读


搭建配置教程

frps.ini

更新配置文件:frps.ini 或者frps_full.ini

[common]
bind_port = 7000 # 默认监听端口,可以修改
vhost_http_port = 80 # http服务默认端口,可以修改
vhost_https_port = 443 # https服务默认端口,可以修改

token = xxxxx # 用于服务端和客户端的验证,自行配置

dashboard_port = 7500 # dashboard配置信息,建议配置
dashboard_user = admin
dashboard_pwd = admin
enable_prometheus = true

log_file = /var/log/frps.log # 日志信息配置,可选
log_level = info
log_max_days = 3

设置后台启动服务

创建并打开文件:frps.service

/etc/systemd/system/frps.service
[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple # 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /root/frp_0.44.0_linux_amd64/frps -c /root/frp_0.44.0_linux_amd64/frps.ini

[Install] WantedBy = multi-user.target

相关命令

systemctl start frps    # 启动服务
systemctl restart frps    # 重启服务
systemctl stop frps    # 停止服务
systemctl status frps    # 查询状态
systemctl enable frps    # 设置开机自启动
systemctl disable frps    # 删除开机自启动

journalctl -u frps -f    # 查询运行日志