Linux install frp

wget https://github.com/fatedier/frp/releases/download/v0.34.3/frp_0.34.3_linux_amd64.tar.gz && tar -xzvf frp_0.34.3_linux_amd64.tar.gz

https://phpez.com/wp-content/uploads/2020/11/frp_0.34.3_linux_amd64.tar.gz

cp -r ~/frp_0.34.3_linux_amd64/ /usr/local/frp/

frps

vim /usr/local/frp/frps.ini
[common]
bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443
token = test

frps.service

vim /etc/systemd/system/frps.service
[Unit]
Description=Frp Server Service
After=network.target

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
LimitNOFILE=infinity
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini

[Install]
WantedBy=multi-user.target
systemctl daemon-reload

systemctl start frps
systemctl status frps
systemctl restart frps
systemctl stop frps

systemctl enable frps
systemctl disable frps

frpc

vim /usr/local/frp/frpc.ini
[common]
server_addr = 0.0.0.0 # Your frp server ip address
server_port = 7000
token = test

[http-example.com]  
type = http
local_ip = 127.0.0.1
local_port = 8000
custom_domains = example.com,www.example.com
 
[https-example.com]  
type = https
#local_ip = 127.0.0.1
#local_port = 8000
custom_domains = example.com,www.example.com

plugin = https2http
plugin_local_addr = 127.0.0.1:8000
plugin_crt_path = /home/ssl/example.com/example.com.pem
plugin_key_path = /home/ssl/example.com/example.com.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X_From-Where = frp

frpc.service

vim /etc/systemd/system/frpc.service
[Unit]
Description=Frp Client Service
After=network.target

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
LimitNOFILE=infinity
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
ExecReload=/usr/local/frp/frpc reload -c /usr/local/frp/frpc.ini

[Install]
WantedBy=multi-user.target
systemctl daemon-reload

systemctl start frpc
systemctl status frpc
systemctl restart frpc
systemctl stop frpc

systemctl enable frpc
systemctl disable frpc
赞(0)
未经允许不得转载:PHPez » Linux install frp

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址