前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >穿墙神器frp的安装与配置

穿墙神器frp的安装与配置

作者头像
老高的技术博客
发布2022-12-28 12:40:23
4810
发布2022-12-28 12:40:23
举报
文章被收录于专栏:老高的技术博客

如题

客户端

centos安装脚本

代码语言:javascript
复制
version=`curl --silent "https://api.github.com/repos/fatedier/frp/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'`
v=`echo $version|grep -Po 'v\K(.*)'`
curl -sSL https://github.com/fatedier/frp/releases/download/$version/frp_"$v"_linux_amd64.tar.gz|tar zx -C /tmp/ -x frp_"$v"_linux_amd64/frpc frp_"$v"_linux_amd64/frpc.ini --strip-components 1
mv /tmp/frpc /usr/local/bin/frpc
mkdir /etc/frp/
mv /tmp/frpc.ini /etc/frp/


cat <<EOF > /etc/systemd/system/frpc.service
[Unit]
Description=frpc daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/local/bin/frpc -c /etc/frp/frpc.ini reload
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

服务管理

代码语言:javascript
复制
systemctl enable frpc
systemctl restart frpc
systemctl status frpc

服务端

centos安装脚本

代码语言:javascript
复制
version=`curl --silent "https://api.github.com/repos/fatedier/frp/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'`
v=`echo $version|grep -Po 'v\K(.*)'`
curl -sSL https://github.com/fatedier/frp/releases/download/$version/frp_"$v"_linux_amd64.tar.gz|tar zx -C /tmp/ -x frp_"$v"_linux_amd64/frps frp_"$v"_linux_amd64/frps.ini --strip-components 1
mv /tmp/frps /usr/local/bin/frps
mkdir /etc/frp/
mv /tmp/frps.ini /etc/frp/

cat <<EOF > /etc/systemd/system/frps.service
[Unit]
Description=frps daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
ExecReload=/usr/local/bin/frps -c /etc/frp/frps.ini reload
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

服务管理

代码语言:javascript
复制
systemctl enable frps
systemctl restart frps
systemctl status frps
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-07-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 客户端
    • centos安装脚本
      • 服务管理
      • 服务端
        • centos安装脚本
          • 服务管理
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档