frps.ini

自用frps.ini配置文件如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[common]
# tunnel port通信管道
bind_port = 7000

# http和https
vhost_http_port = 80
vhost_https_port = 443
log_file = /root/frps/frps.log
token = admin12345

custom_404_page = /root/frps/404.html

# dashboard图形管理页面
dashboard_port = 81

dashboard_user = admin
dashboard_pwd = admin12345

frpc.ini

自用frpc.ini配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[common]
server_addr = xxx.xxx.xxx.xxx
server_port = 7000
log_file = /home/security/frpc/frpc.log
token = 135780qwe

[ssh]
type = tcp
local_port = 22
local_ip = 127.0.0.1
remote_port = 2222

[xxx-web]
type = http
local_port = 80
custom_domains = xxx.xxx.site #域名,此域名解析到frps所在的服务器IP

frps.service

centos7版本

将frps.service拷贝至/etc/systemd/system目录下,赋予777权限,使用systemctl daemon-reload重载配置。使用systemctl start/restart/stop frps即可

1
2
3
4
5
6
7
8
9
[Unit]
Description=frps
After=network.target

[Service]
ExecStart=/root/frps/frps -c /root/frps/frps.ini

[Install]
WantedBy=multi-user.target

frpc.service

ubuntu版本

将frpc.service文件拷贝至/lib/systemd/system目录下,赋予777权限,即可使用systemctl start frpc

1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=fraps service
After=network.target syslog.target
Wants=network.target

[Service]
Type=simple
ExecStart=/home/security/frpc/frpc -c /home/security/frpc/frpc.ini

[Install]
WantedBy=multi-user.target