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.ini2.使用systemctl来控制启动
这个方法比较好用,很方便
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 disable frps如果要重启应用,可以这样,
sudo systemctl restart frps如果要停止应用,可以输入,
sudo systemctl stop frps如果要查看应用的日志,可以输入,
sudo systemctl status frps3.使用supervisor来控制
首先先安装supervisor,
sudo apt install supervisor或者
sudo yum -y install supervisor创建 supervisor frps 配置文件,在
vi /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