前言
本文將詳解在CentOS 7 上安裝配置frp服務器端的教程.
frp 是一個可用於內網穿透的高性能的反向代理應用,支持 tcp, udp 協議,為 http 和 https 應用協議提供了額外的能力,且嘗試性支持了點對點穿透。
服務端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 服務狀態
本文來源於互聯網,經過作者驗證后發布,收藏作為后期查閱使用。