CentOS 7 x64如何安装内网穿透工具frps服务器端

首先:下载最新版frp文件

官方地址:https://github.com/fatedier/frp/releases

wget https://github.com/fatedier/frp/releases/download/v0.18.0/frp_0.19.1_linux_amd64.tar.gz
tar -zxvf frp_0.19.1_linux_amd64.tar.gz
cd frp_0.19.1_linux_amd64

可以删除掉不必要的客户端文件,只是为了更加简洁而已。

rm -f frpc frpc_full.ini frpc.ini

frpc 为客户端文件
frps 为服务器端文件

然后配置服务器端文件

vi frps.ini

#注意这些port端口号要与客户端frpc的配置文件对应起来

[common]
bind_port = 7777
vhost_http_port = 8888
dashboard_port = 9999
dashboard_user = itgeeker
dashboard_pwd = itgeeker
max_pool_count = 5
authentication_timeout = 900

subdomain_host = itgeeker.net

# console or real logFile path like ./frpc.log
log_file = ./frps.log
# debug, info, warn, error
log_level = info
log_max_days = 3

[ssh]
listen_port = 8000
auth_token = itgeekerfrps

详细配置https://github.com/fatedier/frp/blob/master/README_zh.md

# 保存上面配置文件吗,启动 frp 服务器

./frps -c ./frps.ini
#带log输出
./frps -c ./frps.ini -L logs &

服务端配置结束。若需要后台运行,请看下面“”

添加开机启动frp服务端 for centos

方法一:放rc.local里

chmod +x /etc/rc.d/rc.local && vi /etc/rc.d/rc.local
#把下面的内容粘贴到文件末尾
/opt/frp/frps -c /opt/frp/frps.ini

方法二:Centos 7 Systemd 管理

$ sudo cp frps /usr/local/bin/frps
$ sudo mkdir /etc/frp
$ sudo cp frps.ini /etc/frp/frps.ini

编写 FRP SERVICE 文件,以 CENTOS7 为例
$ sudo vi /usr/lib/systemd/system/frps.service

[Unit]
Description=frps
After=network.target

[Service]
TimeoutStartSec=30
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
ExecStop=/bin/kill $MAINPID

[Install]
WantedBy=multi-user.target

# 启动 FRP 并设置开机启动

$ sudo systemctl start frps
$ sudo systemctl enable frps
$ sudo systemctl status frps

frps升级

1. 下载最新版frp文件,
2. 停止frps服务

systemctl stop frps

3. 用新版本覆盖旧版本
4. 如果使用systemd的,记得覆盖:

cp frps /usr/local/bin/

5. 启动新版本frps

systemctl start frps

评论

《“CentOS 7 x64如何安装内网穿透工具frps服务器端”》 有 1 条评论

  1. […] 参考文章:https://www.itgeeker.net/centos-7-x64%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85%E5%86%85%E7%BD%91%E7%A9%BF…。 […]

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

奇客罗方公众号 奇客罗方小程序 奇客罗方客服 ITGeeker Telegram

网站由ITGeeker技术奇客开发并管理;隶属于GeekerCloud奇客罗方智能科技
Site designed and developed by ITGeekerwhich is a sub-website of GeekerCloud
网站地图 | 沪ICP备2021031434号-4