Article directory
Preface
Yearning is a simple and efficient MYSQL audit platform. 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
After downloading, upload the installation package to Linux, here upload it to the /usr/local
folder
Then unzip the file
unzip 文件名
After decompression, you can see a folder namedYearning
,
EnterYearning
folder and you can see the configuration file:conf.toml
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!
Then edit the configuration file:
vim conf.toml
Set the information for connecting to mysql, mainly setting the user name and password for connecting to mysql
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
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
Then run Yearning. Of course, we can use nohup to run this command in the background.
nohup ./Yearning run &
2. Access Yearning locally
After we run Yearning above, access the web interface in an external browser or Linux internal browser You can see the Yearning login interface through the 8000
port, and the local access is successful
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.
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
- Add services to the system
sudo systemctl enable cpolar
- Start cpolar service
sudo systemctl start cpolar
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
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: The name can be customized. 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创建
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
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.
Enter the username and password initialized above to log in successfully.
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. Level subdomain name
After the reservation is successful, copy the name of the second-level subdomain name that was successfully reserved.
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
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)
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.
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.