frps下载安装
使用wget命令来下载frps
wget https://github.com/fatedier/frp/releases/download/v0.49.0/frp_0.49.0_linux_amd64.tar.gz
将文件解压
tar -zxvf frp_0.49.0_linux_amd64.tar.gz
修改文件夹名字,便于记忆
mv frp_0.49.0_linux_amd64 frp
进入frp目录
cd frp
frp配置
编辑配置文件
vim frps.ini
[common]
# frp监听的端口,默认是7000,可以改成其他的
bind_port = 7000
bind_addr=0.0.0.0
# 授权码,请改成更复杂的
token = 123456
# frp管理后台端口,请按自己需求更改
dashboard_port = 80
vhost_http_port=801
vhost_https_port=443
# frp管理后台用户名和密码,请改成自己的
dashboard_user = test
dashboard_pwd = 123456
enable_prometheus = true
# frp日志配置
log_file = /var/log/frps.log
log_level = info
log_max_days = 3
max_pool_count=50
subdomain_host = test.test.com
[example]
type = tcp
local_ip = 127.0.0.1
local_port = 445
remote_port = 44501
运行fprs并查看是否运行成功
./frps -c ./frps.ini
配置开机自启
vim /usr/lib/systemd/system/frp.service
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
systemctl daemon-reload
systemctl enable frp
systemctl start frp