2026 Dafu Lottery Website Source Code Linux Version Baota Panel Deployment Documentation Tutorial

This document provides a detailed introduction on how to deploy the secured and performance-optimized lottery website source code on a Linux server with Baota panel installed. Please strictly follow the steps below.

1. Server Configuration Recommendations

To ensure smooth website operation and fast response, especially in scenarios with high concurrent access and frequent lottery draw calculations, the following server configuration is recommended:

Configuration Item | Description

—|—

CPU and Memory | Directly affects PHP script execution efficiency and database performance. Higher configuration can better handle high concurrent requests and complex lottery draw logic calculations.

Hard Drive | Using SSD or NVMe SSD can greatly improve database read/write speed and file loading speed, thereby significantly reducing page loading time.

Bandwidth | For lottery websites, user online rate and data refresh frequency are high, so sufficient bandwidth is the foundation for ensuring good user experience.

2. Baota Panel Environment Setup

2.1 Installing Baota Panel

Use SSH to log in to your Linux server and execute the following official command to install Baota panel. CentOS system is recommended.

CentOS Installation Script:

“`

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

“`

Ubuntu Installation Script:

“`

wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh

“`

After installation is complete, the command line will display the Baota panel login address, username, and password. Be sure to save this information.

2.2 Installing LNMP Environment

After logging into Baota panel, a window recommending installation packages will pop up. Please select LNMP (Linux + Nginx + MySQL + PHP) environment and install with the following versions:

– Nginx: 1.20 or higher

– MySQL: 5.7 or higher (5.7 recommended for better compatibility)

– PHP: 8.1

– PHPMyAdmin: 5.0 or higher

Click “One-Click Install” and wait for all software to complete installation.

2.3 Installing PHP Extensions

The program requires the fileinfo extension. In Baota panel, go to “Software Store” -> “Installed”, find PHP 8.1, click “Settings”, and in the “Install Extensions” tab, install fileinfo.

3. Deploying the Project

3.1 Uploading and Extracting the Source Code

Upload the provided 500xpjvip_optimized.tar.gz compressed package to the server.

Log into Baota panel and go to the “Files” menu.

Navigate to the /www/wwwroot directory.

Click “Upload” and upload the compressed package to this directory.

After uploading is complete, right-click the compressed package and select “Extract”.

After extraction, you will get a project folder containing all project files.

3.2 Creating Websites

We need to create sites for the frontend, backend, and lottery draw interface separately.

3.2.1 Creating the Frontend Site (web)

Go to the “Website” menu and click “Add Site”.

– Domain: Enter your frontend access domain, e.g., www.yourdomain.com.

– Root Directory: Select /www/wwwroot/project/web.

– PHP Version: Select 8.1.

– Database: Select “Do Not Create”.

Click “Submit”.

3.2.2 Creating the Backend Site (admin)

Click “Add Site” again.

– Domain: Enter your backend access domain, e.g., admin.yourdomain.com.

– Root Directory: Select /www/wwwroot/project/admin.

– PHP Version: Select 8.1.

– Database: Select “Do Not Create”.

Click “Submit”.

3.2.3 Creating the Lottery Draw Site (127.0.0.6)

This site is only used for local execution of lottery draw scripts and does not require external access.

Click “Add Site” again.

– Domain: Enter 127.0.0.1 or localhost.

– Root Directory: Select /www/wwwroot/project/127.0.0.6.

– PHP Version: Select 8.1.

– Database: Select “Do Not Create”.

Click “Submit”.

3.3 Importing the Database

Go to the “Database” menu and click “Add Database”.

– Database Name: duomacc_newdafu

– Username: duomacc_newdafu

– Password: Set a secure password (for example, use Baota’s password generator).

Click “Submit”.

Click “Import” on the right side of the newly created database, upload the provided 500xpjvip.xyz.sql file, and click “Import”.

3.4 Modifying Database Configuration

After importing the database, you need to modify the configuration files of the three modules to connect the program to the new database.

Go to the “Files” menu and edit the following three files respectively:

– /www/wwwroot/project/web/app/Common/Conf/db.php

– /www/wwwroot/project/admin/app/Common/Conf/db.php

– /www/wwwroot/project/127.0.0.6/app/Common/Conf/db.php

Modify the values of ‘DB_USER’, ‘DB_PWD’, ‘DB_NAME’ in the files to the database information you just created.

3.5 Configuring Rewrite Rules

Go to the “Website” menu.

Click “Settings” on the right side of the frontend site.

In the “Rewrite Rules” tab, paste the following content and save:

“`

location / {

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=$1 last;

break;

}

}

“`

Click “Settings” on the right side of the backend site.

In the “Rewrite Rules” tab, paste the same rewrite rule as above and save.

3.6 Setting File Permissions

Go to the “Files” menu and navigate to the /www/wwwroot/project directory.

Right-click the project folder and select “Permissions”.

– Owner: Select www.

– Check “Apply to subdirectories and files”.

– Click “OK”.

Keep the permission value at 755.

4. Configuring the Lottery Draw Collector

The lottery draw script has been converted from Windows .bat script to Linux Shell script, and using systemd for daemon management is recommended to ensure stable operation.

4.1 Setting Up the Startup Script

Go to the “Files” menu and navigate to /www/wwwroot/project/127.0.0.6/.

Confirm that the start_all.sh script exists and has executable permissions. If not, execute the following in Baota’s “Terminal” or SSH:

“`

chmod +x /www/wwwroot/project/127.0.0.6/start_all.sh

“`

4.2 Using Supervisor (Process Guardian Manager)

Baota panel’s “Software Store” provides the Supervisor plugin, which is the simplest way to manage daemon processes.

In “Software Store”, search for and install Supervisor.

After installation is complete, open Supervisor settings and click “Add Daemon Process”.

– Name: Custom, for example, LotteryCollector.

– Startup User: Select www.

– Run Directory: Select /www/wwwroot/project/127.0.0.6.

– Startup Command: Fill in /bin/bash /www/wwwroot/project/127.0.0.6/start_all.sh.

Click “OK”.

Supervisor will automatically start the lottery draw script and automatically restart it if the script exits unexpectedly, ensuring the continuous operation of the lottery service.

4.3 (Alternative) Configuring Crontab Scheduled Checks

As a double backup, you can add a scheduled task to check daily whether the daemon process is still running.

Go to the “Scheduled Tasks” menu.

– Task Type: Select “Shell Script”.

– Task Name: Custom, for example, “Check Lottery Drawer Process”.

– Execution Cycle: Select “Daily”, and execute at an appropriate time (such as 03:00 AM).

– Script Content: Paste the content of /www/wwwroot/project/127.0.0.6/cron_check.sh.

Click “Add Task”.

5. Completion

The entire website has been deployed. You can access the frontend and backend through the domains you set. If you encounter any issues, please first check:

– Whether file permissions are set to www user and 755.

– Whether Nginx rewrite rules are correctly configured.

– Whether database connection information is correct.

– Whether PHP version is 8.1 and the fileinfo extension is installed.

– Whether the lottery draw process in Supervisor is in “Running” status.