frp一键安装脚本,及相关配置

安装frp 服务器, 使用一键脚本快速安装配置

wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install
Please select frps download url:
[1].aliyun (default)
[2].github
Enter your choice (1, 2 or exit. default [aliyun]): 1
---------------------------------------
Your select: 1   #这里选择下载的服务器
---------------------------------------
Loading network version for frps, please wait...
frps Latest release file frp_0.13.0_linux_amd64.tar.gz
Loading You Server IP, please wait...
You Server IP:45.XXX.XX.XXX
Please input your server setting:
Please input frps bind_port [1-65535](Default Server Port: 5443):7000   #输入frps端口
frps bind_port: 7000

Please input frps vhost_http_port [1-65535](Default vhost_http_port: 80):808 #输入frps 穿透http端口
frps vhost_http_port: 808

Please input frps vhost_https_port [1-65535](Default vhost_https_port: 443):88 #输入frps穿透https端口
frps vhost_https_port: 88

Please input frps dashboard_port [1-65535](Default dashboard_port: 6443): #配置frps dashboard WEB信息界面端口
frps dashboard_port: 6443
Please input dashboard_user (Default: admin):maizim   # frps网页端查看信息的用户名
frps dashboard_user: mxmaizi
Please input dashboard_pwd (Default: IJCW0v6p):maizimpass   #frps dashboard 用户密码
frps dashboard_pwd: ggmmivso
Please input privilege_token (Default: 5XJCmMveWIpLIZ4w): #frps token验证, 默认即可,后期会用到。
frps privilege_token: cYseiVv5FFfEEM2B

Please input frps max_pool_count [1-200] #配置frps最大连接池, 默认。。。
(Default max_pool_count: 50):
frps max_pool_count: 50
##### Please select log_level #####
1: info (default)
2: warn
3: error
4: debug
#####################################################
Enter your choice (1, 2, 3, 4 or exit. default [1]): # 日志级别, 信息, 警告, 错误, 调试,
log_level: info

Please input frps log_max_days [1-30]  #日志保存最大天数
(Default log_max_days: 3 day):
frps log_max_days: 3
##### Please select log_file #####
1: enable (default)
2: disable
#####################################################
Enter your choice (1, 2 or exit. default [1]): # 是否开启log功能
log_file: enable
##### Please select tcp_mux #####  
1: enable (default)
2: disable
#####################################################
Enter your choice (1, 2 or exit. default [1]): # tcp_mux支持
tcp_mux: true
##### Please select kcp support #####  
1: enable (default)
2: disable
#####################################################
Enter your choice (1, 2 or exit. default [1]):     #kcp支持
kcp support: true
============== Check your input ==============
You Server IP : 45.xxx.xxx.72
Bind port : 7000
KCP support : true
vhost http port : 800
vhost https port : 6688
Dashboard port : 6443
Privilege token : cYseiVv5FFfEEM2B
tcp_mux : true
Max Pool count : 50
Log level : info
Log max days : 3
Log file : enable
==============================================
Press any key to start...or Press Ctrl+c to cancel  

最后显示当前的配置信息,确认后, 按任意键继续安装。

安装完成后,最终得到服务器配置

#####################################################
Congratulations, frps install completed!
==============================================
You Server IP : 45.xxx.xxx.72
Bind port : 7000
KCP support : true
vhost http port : 800
vhost https port : 6688
Dashboard port : 6443
Privilege token : cYseiVv5FFfEEM2B
tcp_mux : true
Max Pool count : 50
Log level : info
Log max days : 3
Log file : enable
==============================================
frps Dashboard : http://45.xxx.xxx.72:6443/
Dashboard user : maizim
Dashboard password : maizimpass
==============================================
frps status manage : frps {start|stop|restart|status|config|version}
Example:
start: frps start
stop: frps stop
restart: frps restart

相关命令:
frps start #启动
frps stop #关闭
frps restart #重启
frps config #配置

http服务端访问:
配置 nginx 转发相应域名到端口 frp http 808
https服务端配置:
配置 nginx 转发 域名443 到frp https:88

# 客户端配置,这里配置服务器信息。
[common]
server_addr = 45.xx.xx.72
server_port = 7000
privilege_token = cYseiVv5FFfEEM2B
[Hahabao_route]
privilege_mode = true
type = http
local_port = 80
use_gzip = true
custom_domains = home.com

#使用22022 端口访问家里的树莓派
[pi]
type = tcp
local_port = 22
local_ip = 127.0.0.1
remote_port = 22022

#使用域名访问家里的web http服务。
[ONE_http]
privilege_mode = true
type = http
local_ip = 192.168.100.100
local_port = 808
use_gzip = true
custom_domains = pi.maizim.com

#使用域名访问家里的web https服务。
[pi_https]
privilege_mode = true
type = https
local_ip = 192.168.100.100
local_port = 88
use_gzip = true
custom_domains = www.maizim.com 
################################################# 

Leave a Comment