一、安装 systemd
如果 Linux 服务器上尚未安装 systemd的话
# 使用 yum 安装 systemd(CentOS/RHEL)
yum install systemd
# 使用 apt 安装 systemd(Debian/Ubuntu)
apt install systemd
二、创建配置文件
vim /etc/systemd/system/frpc.service
文件内容
[Unit]
# 服务名称,可自定义
Description = frc server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /root/frp_0.65.0_linux_arm64/frpc -c /root/frp_0.65.0_linux_arm64/frpc.toml
[Install]
WantedBy = multi-user.target
三、管理命令
# 启动frp
systemctl start frps
# 停止frp
systemctl stop frps
# 重启frp
systemctl restart frps
# 查看frp状态
systemctl status frps
# 开机自启动
systemctl enable frpc