Ubuntu installs Frp server, non-client
Download and extract FRP
- Latest FRP release: https://github.com/fatedier/frp/releases/
cd ~
mkdir frp
cd frp
wget https://github.com/fatedier/frp/releases/download/v0.35.0/frp_0.35.0_linux_amd64.tar.gz
tar -xvzf frp_0.35.0_linux_amd64.tar.gz
cd frp_0.35.0_linux_amd64
Configure FRP
-
Remove the default client configuration file
-
Create the server configuration file
cd ~/frp/frp_0.35.0_linux_amd64/
rm frpc
rm frpc.ini
rm frpc_full.ini
ls -a
sudo su
rm frps.ini
cat>/etc/frps.ini<<EOF
[common]
# FRP server bind port
bind_port = 1000
# Set the HTTP access port to 1001
vhost_http_port = 1001
# Set the domain name (make sure it is reachable)
subdomain_host = frp.margrop.net
# Configure the dashboard (optional)
dashboard_port = 3456
# Dashboard username and password, both default to `admin`
dashboard_user = admin
dashboard_pwd = admin
EOF
Start the FRP server
Set the FRP server to start automatically
-
Configuration file link
-
Grant execute permission, edit
rc.local, and add the commands that should run at boot
Reference:
cd ~/frp/frp_0.35.0_linux_amd64/
nohup ./frps -c /etc/frps.ini &
Set FRP server auto-start
- Configuration file link
ln -fs /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
cd /etc/systemd/system/
cat rc-local.service
echo >> rc-local.service
echo [Install] >> rc-local.service
echo WantedBy=multi-user.target >> rc-local.service
echo Alias=rc-local.service >> rc-local.service
- Grant execute permission, edit
rc.local, and add the commands that should run at boot
echo '#!/bin/bash' >> /etc/rc.local
echo 'cd ~/frp/frp_0.35.0_linux_amd64/' >> /etc/rc.local
echo "nohup ./frps -c /etc/frps.ini &" >> /etc/rc.local
chmod 755 /etc/rc.local
cat /etc/rc.local
Reference https://blog.csdn.net/u013144287/article/details/78589643