Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build an intranet to penetrate frp and set up the method of automatic boot in CentOS8

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces CentOS8 how to build an intranet through frp and set up the boot automatic startup method, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.

In the current era when all kinds of NAS and private clouds are popular, if you want others to access or test the locally built Web server through the domain name, but the local computer does not have a fixed IP on the public network, so the domain name cannot be resolved to the local computer. This function can be achieved through frp. The following example is that the http Service,https service is configured in the same way, replacing vhost_http_port with vhost_https_port and setting the type to https.

Start downloading

SSH connects to your Linux extranet server to download frp files. Generally, Linux 64-bit downloads this frp_0.34.0_linux_amd64.tar.gz.

# Linux 32-bit system wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_386.tar.gz#Linux 64-bit system wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_amd64.tar.gz#Mac system wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34 . 0_darwin_amd64.tar.gz# begins to decompress

Extract the tar.gz file

Tar-zxvf frp_0.34.0_linux_amd64.tar.gz

Enter the extracted directory (the following is my latest version 2020-09-24)

Cd frp_0.34.0_linux_amd64

Start server settings

The server configuration file is frps.ini

[common] # system port bind_port = 700 ports accessed on the web, such as: test1.zuigao.com:8089vhost_http_port = 8089 [web] type = httpcustom_domains = test1.zuigao.comauth_token = 123456 start client settings

According to your system, the client downloads the corresponding frp file above. The operation method is the same, but the configuration file is different, and the file operated by the client is frpc.ini.

[common] server_addr = test1.zuigao.comserver_port = 7000auth_token = 123456 [web] type = http# local service port local_port = 8080custom_domains = test1.zuigao.comfrp there are many uses, you can refer to the detailed documentation and download address

Https://gofrp.org

Frp startup mode 1: the current window is running, closing the current window will exit automatically

Server side

/ directory where frp is stored / frps-c / directory where frp is stored / frps.ini

Client

/ directory where frp is stored / frpc-c / directory where frp is stored / frpc.ini

Frp startup mode 2: run in the background, you can close the current window and will not exit automatically

Server side

Nohup / directory where frp is stored / frps-c / directory where frp is stored / frps.ini > / dev/null 2 > & 1 &

Client

Nohup / directory where frp is stored / frpc-c / directory where frp is stored / frpc.ini > / dev/null 2 > & 1 &

Frp startup mode 3: run in the background in the form of a service

Create a server

Sudo nano / lib/systemd/system/frps.service

Server configuration

[Unit] Description=fraps serviceAfter=network.target syslog.targetWants= network.target [service] Type=simple# commands to start the service ExecStart=/ store frp directory / frps-c / directory where frp is stored / frps.ini [install] WantedBy=multi-user.target

Start the service systemctl start frps

Boot self-boot systemctl enable frps

Restart the service systemctl restart frps

Stop serving systemctl stop frps

View log and status systemctl status frps

Create a client

Sudo nano / lib/systemd/system/frpc.service

Client configuration

[Unit] Description=fraps serviceAfter=network.target syslog.targetWants= network.target [service] Type=simple# commands to start the service ExecStart=/ store frp directory / frpc-c / directory where frp is stored / frpc.ini [install] WantedBy=multi-user.target

Start the service systemctl start frpc

Boot self-boot systemctl enable frpc

Restart the service systemctl restart frpc

Stop serving systemctl stop frpc

View log and status systemctl status frpc

Frp stop method

Paste the following command to find the process number that frp is running

Ps-aux | grep frp | grep-v grep

Root 2345860 0.0 0.5 716068 23952? Sl September 23 0:08. / frps-c. / frps.ini

My process number here is 2345860.

Kill-9 2345860

Thank you for reading this article carefully. I hope the article "how to build CentOS8 to penetrate the frp and set up the automatic boot method" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report