1. 下載frp程序文件
https://github.com/fatedier/frp/releases
2. 解壓文件
下載后解壓到自己的目錄,我這里解壓到/usr/local/frp:
3. 添加systemd配置文件:
vim /usr/lib/systemd/system/frp.service
文件內容如下:
[Unit] Description=The nginx HTTP and reverse proxy server After=network.target remote-fs.target nss-lookup.target [Service] 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 [Install] WantedBy=multi-user.target
ExecStart的內容請根據自己frp安裝目錄修改。
4. 設置開機啟動
systemctl daemon-reload
systemctl enable frp
5. 啟動 frp
systemctl start frp
6. 查看frp是否啟動
ps aux | grep frp
看到這里就說明啟動成功了。