1.项目简介
原地址:stilleshan/frpc
基于 fatedier/frp 原版 frp 内网穿透客户端 frpc 的一键安装卸载脚本和 docker 镜像.支持群晖NAS,Linux 服务器和 docker 等多种环境安装部署
2.使用
以下分为四种部署方法,请根据实际情况自行选择
- Linux 服务器 一键脚本安装 [内网 Linux 服务器或虚拟机]
- Linux 服务器 docker 安装 [内网 Linux 服务器或虚拟机]
安装
本脚本支持Linux X86 和 ARM架构
-
GitHub脚本
wget https://raw.githubusercontent.com/stilleshan/frpc/master/frpc_linux_install.sh && chmod +x frpc_linux_install.sh && ./frpc_linux_install.sh -
国内脚本
wget https://ghfast.top/https://raw.githubusercontent.com/stilleshan/frpc/master/frpc_linux_install.sh && chmod +x frpc_linux_install.sh && ./frpc_linux_install.sh
卸载
- GitHub脚本
wget https://raw.githubusercontent.com/stilleshan/frpc/master/frpc_linux_uninstall.sh && chmod +x frpc_linux_uninstall.sh && ./frpc_linux_uninstall.sh
-
国内脚本
wget https://ghfast.top/https://raw.githubusercontent.com/stilleshan/frpc/master/frpc_linux_uninstall.sh && chmod +x frpc_linux_uninstall.sh && ./frpc_linux_uninstall.sh
使用
修改 frpc.toml 配置文件
vi /usr/local/frp/frpc.toml
重启FRPC服务
systemctl restart frpc
启动FRPC服务
systemctl start frpc
关闭FRPC服务
systemctl stop frpc
查看FRPC状态
systemctl status frpc
设置开机自启
systemctl enable frpc
查看服务是否开机自启
systemctl is-enabled frpc
frpc.toml配置编写示例
以ChmlFrp为例
[common]
server_addr = 154.83.xxxx
server_port = 7000
tls_enable = false
user = 9rQjI6cKMzb7Y7Irxxxxxxxx
token = ChmlFrpToken
# 服务1
[moon_https]
type = https
custom_domains = luweixiu.asia
# 本地 SSL 证书(关键配置)
plugin = https2http
plugin_local_addr = 192.168.2.10:3100
plugin_crt_path = /证书/luweixiu.asia/luweixiu.asia.crt
plugin_key_path = /证书/luweixiu.asia/luweixiu.asia.key
plugin_host = luweixiu.asia
# 服务2
[Halo_https]
type = https
custom_domains = halo.luweixiu.asia
# 本地 SSL 证书(关键配置)
plugin = https2http
plugin_local_addr = 192.168.2.10:8090
plugin_crt_path = /证书/halo.luweixiu.asia/halo.luweixiu.asia.crt
plugin_key_path = /证书/halo.luweixiu.asia/halo.luweixiu.asia.key
plugin_host = halo.luweixiu.asia
# 服务3
[Halo_http]
type = http
local_ip = 192.168.2.10
local_port = 8090
custom_domains = halo.luweixiu.asia
use_encryption = true
开机自启配置文件
开机自启配置文件路径 /lib/systemd/system/frpc.service
[Unit]
Description=Frp Server Service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.toml
[Install]
WantedBy=multi-user.target