frp內網穿透配置
阿新 • • 發佈:2021-08-30
一、安裝frp
1、下載壓縮包
2、解壓包
tar -zxvf frp_0.37.1_linux_amd64.tar.gz
3、執行伺服器端程式
cd frp_*
./frps -c ./frps.ini
# frps.ini [common] bind_port = 7000 dashboard_port = 7500 dashboard_user = pascall dashboard_pwd = pascall
4、執行客戶端程式
cd frp_*
./frpc -c ./frpc.ini
# frpc.ini # x.x.x.x 伺服器端外網ip [common] server_addr= x.x.x.x server_port = 7000 admin_addr = 0.0.0.0 admin_port = 7500 admin_user = pascall admin_pwd = pascall [http] type = tcp local_ip = 192.168.1.14 local_port = 80 remote_port = 80
二、防止frp程式宕機
1、伺服器端配置
yum install -y supervisor
vim /etc/supervisord.d/frp.ini
[program:frp] directory = /root/frp command=/root/frp/frps -c /root/frp/frps.ini autostart= true numprocs=1 process_name=%(program_name)s user=root autorestart=true redirect_stderr=true stdout_logfile = /root/frp.log loglevel=info
systemctl enable supervisord
systemctl start supervisord
systemctl status supervisord
2、客戶端配置
yum install -y supervisor
vim /etc/supervisord.d/frp.ini
[program:frp] directory= /root/frp command=/root/frp/frpc -c /root/frp/frpc.ini autostart = true numprocs=1 process_name=%(program_name)s user=root autorestart=true redirect_stderr=true stdout_logfile = /root/frp.log loglevel=info
systemctl enable supervisord
systemctl start supervisord
systemctl status supervisord