Frp后台自动启动的几个方法

1.使用nohup

这是frps的后台启动(路径写你服务器上的绝对路径),如果要查看日志的话,就直接使用cat nohup.out,就可以查看了。

nohup /path/to/your/fprs -c-c /path/to/your/frps.ini

这是frpc的后台启动

nohup /path/to/your/fprc -c-c /path/to/your/frpc.ini

 

2.使用systemctl

这个方法比较好用,很方便

sudo vim /lib/systemd/system/frps.service

在frps.service里写入以下内容

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

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

[Install]
WantedBy=multi-user.target

启动frps

sudo systemctl start frps

开机启动

sudo systemctl enable frps

重启应用

sudo systemctl restart frps

停止应用

sudo systemctl stop frps

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

sudo systemctl status frps

 

3.使用supervisor

首先先安装supervisor,我用的ubuntu

sudo apt install supervisor

创建 supervisor frps 配置文件,在 /etc/supervisor/conf.d 创建 frp.conf

[program:frp]
command = /your/path/frps -c /your/path/frps.ini
autostart = true

同样是你的绝对路径。

写完以后,要重新加载一下supervisor

# 重启supervisor
sudo systemctl restart supervisor
# 查看supervisor运行状态
sudo supervisorctl status

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

本站文章资源均来源自网络,除非特别声明,否则均不代表站方观点,并仅供查阅,不作为任何参考依据!
如有侵权请及时跟我们联系,本站将及时删除!
如遇版权问题,请查看 本站版权声明
THE END
分享
二维码
海报
Frp后台自动启动的几个方法
1.使用nohup 这是frps的后台启动(路径写你服务器上的绝对路径),如果要查看日志的话,就直接使用cat nohup.out,就可以查看了。 nohup /path/to/your/fprs -……
<<上一篇
下一篇>>
文章目录
关闭
目 录