Centos7下Frp服务端后台运行以及开机自启(Frp客户端同理)

使用systemctl来控制启动

vim /lib/systemd/system/frps.service

在frps.service里写入以下内容

[Unit]
Description=frps service
After=network.target syslog.target
Wants=network.target

[Service]
Type=simple
#启动服务的命令(此处写你的frps的实际安装目录)
ExecStart=/test/frp_0.20.0_linux_amd64/frps -c /test/frp_0.20.0_linux_amd64/frps.ini

[Install]
WantedBy=multi-user.target

然后就启动frps

systemctl start frps

再打开自启动

systemctl enable frps

关闭开机自启动

systemctl  disable frps

如果要重启应用,可以这样

systemctl restart frps

如果要停止应用,可以输入

systemctl stop frps

如果要查看应用的日志,可以输入

systemctl status frps

这是写的frps的后台启动,frpc的话,类比一下就可以了。

最后修改:2021 年 06 月 25 日
如果觉得我的文章对你有用,请随意赞赏