FRP使用记录

2017-09-07 1451点热度 0人点赞 0条评论

ssh

客户端配置:

[common]
server_addr = frpzj.lu8.win
server_port = 7000
log_file = ./frpc.log
log_level = info
log_max_days = 3
privilege_token = frp888

[ssh922]
privilege_mode = true
type = tcp
local_ip = 127.0.0.1
local_port = 922
remote_port = 50922
use_encryption = true
use_compression = true

然后连接ssh的时候服务器配置:frpzj.lu8.win
端口配置50922
输入用户名和密码即可连接

后台启动脚本

startssh.sh

nohup /var/services/homes/wangxianfeng/soft/frp/frp_0.13.0_linux_amd64/frpc -c frpc.ini &

stopssh.sh

num=0
ps -ef | grep "frpc" | grep -v grep | grep $LOGNAME | awk '{print $2}'|while read frpcid
do
        echo "\n\t process exist!:" $frpcid
        echo ""
        kill $frpcid
        num=num+1
done
if [$num = 0]; then
        echo "There're no frpc process running!"
else
        echo "$num frpc process killed!"
fi

web端口

客户端配置:

dswp.ini

[common]
#server_addr服务器地址
server_addr = frp.lu8.win
#服务器端口
server_port = 7000
log_file = ./http.log
log_level = info
log_max_days = 3
#特权连接密码
privilege_token = frp888
 
[dswp]
#privilege_mode特权模式
privilege_mode = true
type = http
local_ip = 192.168.2.99
local_port = 80
use_gzip = true
use_encryption = true
#custom_domains域名
custom_domains = www.wangxianfeng.cn
pool_count = 100

dssolr.ini

[common]
#server_addr服务器地址
server_addr = frp.lu8.win
#服务器端口
server_port = 7000
log_file = ./http.log
log_level = info
log_max_days = 3
#特权连接密码
privilege_token = frp888
 
[dssolr]
#privilege_mode特权模式
privilege_mode = true
type = http
local_ip = 192.168.2.99
local_port = 8983
use_gzip = true
use_encryption = true
#custom_domains域名
custom_domains = solr.wangxianfeng.cn
pool_count = 100

后台启动脚本

starthttp.sh

nohup /var/services/homes/wangxianfeng/soft/frp/9.3/frpc -c dswp.ini &
nohup /var/services/homes/wangxianfeng/soft/frp/9.3/frpc -c dssolr.ini &

stophttp.sh

num=0
ps -ef | grep "frp/9.3" | grep -v grep | grep $LOGNAME | awk '{print $2}'|while read frpcid
do
        echo "\n\t process exist!:" $frpcid
        echo ""
        kill $frpcid
        num=num+1
done
if [$num = 0]; then
        echo "There're no frpc process running!"
else
        echo "$num frpc process killed!"
fi

王显锋

激情工作,快乐生活!

文章评论