下载安装
在Github上找到对应芯片的代码包,这里以英特尔芯片举例
下载到当前目录
[root@myserver ~] wget https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_linux_386.tar.gz
[root@myserver ~] pwd
/root
解压压缩包
[root@myserver ~] tar -zxvf frp_0.51.3_linux_386.tar.gz
[root@myserver ~] ls
anaconda-ks.cfg frp_0.51.3_linux_386 frp_0.51.3_linux_386.tar.gz
修改文件夹命名
[root@myserver ~] mv frp_0.51.3_linux_386 frp
设置基础参数
[root@myserver ~] cd frp
[root@myserver ~] yum install -y vim
[root@myserver ~] vim frpc.ini
#此处省略配置,具体参考官网根据实际业务需求。
[root@myserver ~] ./frpc -c ./frpc.ini
使用systemd出现错误
[root@myserver ~] systemctl start frpc
● frpc.service - frp server
Loaded: loaded (/etc/systemd/system/frpc.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2023-09-04 18:26:03 CST; 3s ago
Process: 58225 ExecStart=/root/frp/frpc -c /root/frp/frpc.ini (code=exited, status=203/EXEC)
Main PID: 58225 (code=exited, status=203/EXEC)
9月 04 18:26:03 apipost systemd[1]: Started frp server.
9月 04 18:26:03 apipost systemd[1]: frpc.service: Main process exited, code=exited, status=203/EXEC
9月 04 18:26:03 apipost systemd[1]: frpc.service: Failed with result 'exit-code'.
考虑受selinux影响,关闭selinux
[root@myserver ~] getenforce
Permissive 或 Enforcing
#执行命令永久关闭selinux
[root@myserver ~] vim /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing 【这里需要修改为disabled】
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
:wq
[root@myserver ~] reboot
解决服务启动失败的问题,有其他问题请在评论区回复