Linux local Yearning SQL audit platform public network remote access

Table of contents

1 Introduction

2. Access Yearning locally

3. Linux installation cpolar

4. Configure the Yearning public network access address

5. Remote access to Yearning management interface through public network

6. Fixed Yearning public network address


Preface

Yearning's simple, efficient MYSQL audit platform is a MYSQL SQL statement/query audit tool for DBAs and developers. Locally deployed, privacy-focused, simple and efficient MYSQL audit platform.

The following introduces how to simply deploy Yearning on Linux and combine it with the cpolar intranet penetration tool to achieve remote access, break access restrictions, and improve work efficiency!!

## 1. Linux deployment Yearning

Download the corresponding Linux installation package on Github: https://github.com/cookieY/Yearning/releases/latest

image-20230915141839218

After downloading, upload the installation package to Linux, upload it to /usr/localthe folder here

image-20230915142104403

Then unzip the file

unzip 文件名

Bash

Copy

After unzipping, you can see a Yearningfolder named,

image-20230915142501951

Enter Yearningthe folder and you can see the configuration file:conf.toml

image-20230915142929202

Next, you need to modify the configuration file and configure the mysql database connection. If mysql is not installed, you need to install it in advance, then log in to mysql and create a database named Yearning!

image-20230915143642919

Then edit the configuration file:

vim conf.toml

Bash

Copy

Set the information for connecting to mysql, mainly setting the user name and password for connecting to mysql

image-20230915143843233

After setting is completed, save the configuration file and execute the following command to install. Note that the current directory must remain in the decompressed Yearning folder.

./Yearning install

Bash

Copy

After execution, you can see the following information, the user name and password to log in to the web interface, and the port to access the web interface:8000

image-20230915144139816

Then run Yearning. Of course, we can use nohup to run this command in the background.

nohup ./Yearning run &

Bash

Copy

2. Access Yearning locally

After we run Yearning above, access the web interface port in an external browser or Linux internal browser 8000to see the Yearning login interface. The local access is successful.

image-20230915144838185

Enter the username and password we saw above to log in successfully. After the local access is confirmed, we then install the cpolar intranet penetration tool and configure it to achieve remote access to Yearning.

image-20230915144955406

3. Linux installation cpolar

We successfully installed Yearning above. Next, we installed the cpolar intranet penetration tool on Linux and forwarded the http public network address mapped by the local port through cpolar. We can easily achieve remote access without having to register a domain name and purchase a cloud server. The following is Install cpolar steps

cpolar official website address: https://www.cpolar.com

  • Use one-click script installation command
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash

Bash

Copy

  • Add services to the system
sudo systemctl enable cpolar

Bash

Copy

  • Start cpolar service
sudo systemctl start cpolar

Bash

Copy

After cpolar is successfully installed, access Linux port 9200 on an external browser: [http://LAN ip:9200]. Log in using your cpolar account. After logging in, you can see the cpolar web configuration interface, which is connected to the web management interface. Just configure

image-20230831171159175

4. Configure the Yearning public network access address

Click Tunnel Management - Create Tunnel on the left dashboard to create a Yearning cpolar public network address tunnel!

  • Tunnel name: You can customize the name. Be careful not to duplicate the existing tunnel name.
  • Protocol: Select http
  • Local address: 8000
  • Domain name type: Choose a random domain name for free
  • Region: Select China vip

Click创建

image-20230915150126928

After the tunnel is successfully created, click the status on the left - online tunnel list to view the generated public network access address. There are two access methods, one is http and https

image-20230915150156300

5. Remote access to Yearning management interface through public network

Use the above https public network address to access it in the browser of any device, and you can successfully see our Yearning interface. In this way, a public network address that can be accessed remotely is created.

image-20230915150236107

Enter the username and password initialized above to log in successfully.

image-20230915150329597

6. Fixed Yearning public network address

Since the tunnel created using cpolar above uses a random public network address, it will change randomly within 24 hours, which is not conducive to long-term remote access. Therefore, we can configure a second-level subdomain name for it. This address is a fixed address and will not change randomly [ps: cpolar.cn has been filed]

Note that you need to upgrade the cpolar package to a basic package or above, and the bandwidth corresponding to each package is different. [cpolar.cn has been registered]

Log in to the cpolar official website , click Reserve on the left, select to reserve the second-level subdomain name, set a second-level subdomain name, click Reserve, and copy the reserved second-level subdomain name after the reservation is successful.

image-20230915150512690

After the reservation is successful, copy the name of the second-level subdomain name that was successfully reserved.

image-20230915150541144

Return to the cpolar web UI management interface, click Tunnel Management - Tunnel List on the left dashboard, find the tunnel you want to configure, and click Edit on the right

image-20230915150609402

Modify the tunnel information and configure the successfully reserved second-level subdomain name into the tunnel.

  • Domain name type: Select a second-level subdomain name
  • Sub Domain: Fill in the successfully reserved second-level subdomain name

Click 更新(note, click once to update, no need to submit again)

image-20230915150652388

After the update is completed, open the online tunnel list. At this time, you can see that the public network address has changed and the address name has become a fixed second-level subdomain name.

image-20230915150725015

Finally, we use a fixed public network address to access Yearning. We can see that the access is successful. In this way, a fixed and permanent public network address is set. To access a new address, you may need to log in again.

image-20230915150828611

Guess you like

Origin blog.csdn.net/wly476923083/article/details/132955121