zhangqiang 发表于 2022-7-28 17:41:17

CentOS7 安装frp与开机启动

1. 下载frp程序文件
https://github.com/fatedier/frp/releases
2. 解压文件
下载后解压到自己的目录,我这里解压到/usr/local/frp:
https://img2018.cnblogs.com/blog/1513806/201905/1513806-20190517110739825-1402093799.png3. 添加systemd配置文件:
vim /usr/lib/systemd/system/frp.service
文件内容如下:
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target


Type=simple
ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true
StandardOutput=syslog
StandardError=inherit


WantedBy=multi-user.target
ExecStart的内容请根据自己frp安装目录修改。
4. 设置开机启动
systemctl daemon-reloadsystemctl enable frp
5. 启动 frp
systemctl start frp
6. 查看frp是否启动
ps aux | grep frp
https://img2018.cnblogs.com/blog/1513806/201905/1513806-20190516202648132-214227142.png看到这里就说明启动成功了。

页: [1]
查看完整版本: CentOS7 安装frp与开机启动