阿里云轻量服务器新版本frp配置【toml】-软件测试牛翰社区-编程开发-牛翰网

阿里云轻量服务器新版本frp配置【toml】

官网下载frp [    https://github.com/fatedier/frp/releases    ]

 1.frps配置(服务端)

解压

tar -zxvf frp_0.60.0_linux_amd64.tar.gz

进入该目录

cd frp_0.60.0_linux_amd64

编辑frps.toml

vim frps.toml

往里面写入

# frps.toml bindPort = 7000 # 服务端与客户端通信端口 vhostHTTPPort = 80 # 如果客户端需要使用http服务,在这里配置代理端口 auth.token = "token" # 身份验证令牌,frpc要与frps一致
# Server Dashboard,可以查看frp服务状态以及统计信息 webServer.addr
= "0.0.0.0" # 后台管理地址 webServer.port = 7500 # 后台管理端口 webServer.user = "admin" # 后台登录用户名 webServer.password = "admin" # 后台登录密码

保存退出

# 把需要的东西复制过去
sudo cp frps /usr/bin/frps sudo cp frps.toml /etc/frp/frps.toml

开机自启配置

sudo vim /lib/systemd/system/frps.service

写入以下内容:

[Unit] Description=Frp Server Service After=network.target [Service] Type=simple User=nobody Restart=on-failure RestartSec=5s ExecStart=/usr/bin/frps -c /etc/frp/frps.toml [Install] WantedBy=multi-user.target

依次执行

# 如果以前配置过
sudo systemctl daemon-reload
#
启动frp sudo systemctl start frps # 停止frp sudo systemctl stop frps # 重启frp sudo systemctl restart frps # 查看frp状态 sudo systemctl status frps # 设置为开机自启 sudo systemctl enable frps

 2.frpc配置(客户端)

 除了配置不一样,其他和上面一样。就是frps换成frpc就完事了

 

 

请登录后发表评论

    没有回复内容