Tutorial for Building a Full-Featured Rainbow Aggregated DNS Management System Using Haozi Panel

Rainbow Aggregate DNS Management System is a website program developed based on ThinkPHP. It allows managing domain name resolution for multiple platforms within a single website, can also issue HTTPS certificates and sync them to multiple cloud platforms, and can be used for website monitoring and active-standby switching, making it extremely useful. This article explains how to deploy the fully functional Rainbow Aggregate DNS Management System on Haozi Panel, and you can also refer to it for Baota Panel (the steps are basically the same).

Prepare Runtime Environment

Haozi Panel needs to be upgraded to v2.4.12 or higher, otherwise PHP will lack the ssh2 extension.

The Rainbow Aggregate DNS Management System is currently developed with ThinkPHP 6.x, requiring a PHP 7.4-8.3 environment, which can be installed with one click in the panel backend.

You will also need a MySQL database, any version is acceptable, this article uses version 8.4 for demonstration.

PHP needs to have the ssh2 and swoole extensions installed to support server deployment and second-level website monitoring, which can be installed directly in the panel backend.

The runtime environment preparation is now complete.

Prepare Website Environment

Go to the release page to download the latest version of the Rainbow Aggregate DNS Management System source code.

After downloading, create a new website in the panel and upload and extract the source code.

Modify the website configuration, add /public to the running directory, and select thinkphp for pseudo-static.

Enabling HTTPS is recommended for better security, we will not enable it for this demonstration.

Finally save the configuration to start the installation.

Install Rainbow Aggregate DNS Management System

Open the newly created website in your browser, it will automatically redirect to the installation page, fill in the database information configured when creating the website earlier.

Click install and wait for the installation to complete.

Configure Scheduled Tasks and Process Guarding

After installation is complete, enter the backend, you will see that the disaster recovery switching has stopped running.

Go to the DNS disaster recovery switching page to get the startup command.

Install and open the Supervisor manager in the panel (Baota Panel calls it Process Guard Manager), add a process guard.

It is recommended to change the php command to php74 to avoid errors caused by the default use of a higher PHP version when multiple PHP versions are installed at the same time. If the log shows that the Swoole extension is not installed, please refer to the section on missing extensions here: 面板 Supervisor 管理器常见问题

After the process starts, you can see that the DNS disaster recovery switching page shows that it is running.

Next, configure scheduled tasks, go to the DNS scheduled tasks page to get the first scheduled task command.

Go to Panel → Tasks → Scheduled Tasks, create a run script task with a 1-minute cycle.

Note that we use the www user to run the task, so the command should be wrapped with sudo -u www bash -c, and it is recommended to change the php command to /usr/local/bin/php74 to avoid errors caused by the default use of a higher PHP version when multiple PHP versions are installed at the same time.

Go back to the CF Optimal IP Settings page under DNS to get the second scheduled task command.

Go to Panel → Tasks → Scheduled Tasks again, create another run script task with a 15-minute cycle.

Once the scheduled tasks are created, the entire deployment is complete, and all functions can be used.

For future updates, just download the new version of the source code and extract and overwrite it in the website directory.