内网穿透神器FRP一键部署脚本centos7

前言

本文将详解在CentOS 7 上安装配置frp服务器端的教程.

服务端frps安装

1  一键安装卸载脚本
2 安装脚本
3 
4 wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh
5 卸载脚本
6 
7 wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh

如现有服务器上已存在 frps 服务,请先运行卸载脚本,在运行安装脚本.

安装完成后配置frps.ini并重启服务.

1 vi /usr/local/frp/frps.ini
2 # 修改 frps.ini 配置
3 sudo systemctl restart frps
4 # 重启 frps 服务即可生效

 

配置参考

 1 [common]
 2 bind_addr = 0.0.0.0
 3 bind_port = 7000
 4 bind_udp_port = 7001
 5 kcp_bind_port = 7000
 6 vhost_http_port = 80
 7 vhost_https_port = 443
 8 dashboard_addr = 0.0.0.0
 9 dashboard_port = 7500
10 dashboard_user = admin
11 dashboard_pwd = admin         # 这里设置为管理面板配置的密码
12 log_file = ./frps.log
13 log_level = info
14 log_max_days = 3
15 disable_log_color = false
16 token = 12345678              # 这里设置为客户端配置的token
17 allow_ports = 2000-3000,3001,3003,4000-50000
18 max_pool_count = 5
19 max_ports_per_client = 0
20 subdomain_host = frps.com
21 tcp_mux = true

使用systemctl命令来控制frps

 1 sudo systemctl start frps
 2 # 启动frps
 3 sudo systemctl enable frps
 4 # 服务器开机自动启动frps
 5 sudo systemctl status frps
 6 # 查看状态
 7 sudo systemctl restart frps
 8 # 重启frps
 9 sudo systemctl stop frps
10 # 停止frps

 

 

检查服务器端安装情况

输入http://服务器IP:7500来查看 frps 服务状态

本文来源于互联网,经过作者验证后发布,收藏作为后期查阅使用。

posted @ 2021-06-23 11:29  wukongroot  阅读(4007)  评论(0编辑  收藏  举报