安装下载:
https://github.com/fatedier/frp/releases
frp_0.49.0_linux_amd64.tar.gz
服务器解压编辑frps.ini编辑:
[common]
bind_port = 7000
vhost_https_port = 7001
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = password
log_file = ./frps.log
log_level = info
log_max_days = 3
authentication_timeout = 0
max_pool_count = 50
token = YJsg9xHUqrnY
启动:
./frps -c frps.ini
打开网页:
http://IP:7500/
firewall-cmd --zone=public --add-port=7500/tcp --permanent
firewall-cmd --zone=public --add-port=7000/tcp --permanent
firewall-cmd --zone=public --add-port=7001/tcp --permanent
firewall-cmd --zone=public --add-port=7002/tcp --permanent
firewall-cmd --reload
-----------------
自启动:
vi /lib/systemd/system/frps.service
======
[Unit]
Description=frps service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
#启动服务的命令(此处写你的frps的实际安装目录)
ExecStart=/www/wwwroot/frp/frps -c /www/wwwroot/frp/frps.ini
[Install]
WantedBy=multi-user.target
======
然后就启动frps
systemctl start frps
再打开自启动
systemctl enable frps
关闭开机自启动
systemctl disable frps
如果要重启应用,可以这样
systemctl restart frps
如果要停止应用,可以输入
systemctl stop frps
如果要查看应用的日志,可以输入
systemctl status frps
如有问题进入/etc/systemd/system/multi-user.target.wants/ ,删除同名文件,问题解决。
========================
客户端frpc.ini:
[common]
server_addr = IP
server_port = 7000
token = YJsg9xHUqrnY
[ONE]
type = http
local_ip = 192.168.1.1
local_port = 80
custom_domains = two.du74.win
[TWO]
type = https
local_ip = 192.168.1.2
local_port = 443
custom_domains = two.du74.win
文章评论