AnQiCMS is a corporate-level content management system developed based on the Go language, known for its high efficiency, security, and customizable features, and has become the ideal choice for many small and medium-sized enterprises and content operation teams.As a long-term website operator dealing with AnQiCMS, I am well aware of the importance of the convenience of system deployment to operational efficiency.Although AnQiCMS recommends using the newer Baota panel's Go project features for deployment, many users may still be using the older version of Baota panel, or may need to deploy in a non-Go project way due to specific requirements.This article will detail how to deploy and run AnQiCMS in the environment of the old Baota panel (non-Go project), helping you easily set up a powerful content management platform.
Prepare AnQiCMS installation package
The first step in deploying AnQiCMS is to obtain its core program. You can download the latest stable Linux installation package from AnQiCMS's official website, which is usually a compressed file, such asanqicms-linux-v3.x.x.zip.
After the download is complete, log in to your Baota panel. In the left menu, select "Files" and navigate to the server's/www/wwwroot/The directory. Create a new folder under this directory, name it according to the domain you will bind to, for exampleyourdomain.com.Enter the newly created folder, upload the previously downloaded AnQiCMS Linux installation package to it.After uploading, right-click on the compressed package, select 'Extract' to release its contents to the current folder.
Database environment preparation
AnQiCMS needs a MySQL database to store all its data.Before deployment, please make sure that the MySQL database service is installed and running on your server.If you have not installed it yet, you can search and install MySQL in the "Software Store" of Baota panel.
After installation, you need to create a new database and the corresponding database user, and set a strong password for it.Or, if you are using the Docker version of MySQL on Baota panel, you can obtain the password of its root user.During the initialization installation of AnQiCMS, you will need to provide these database connection information to ensure that the system can interact with the database correctly.
Configure website environment (Nginx or Apache)
In the old Baota panel, there is usually no independent management function directly for Go language projects, so we need to configure Nginx or Apache's reverse proxy to access the website.
First, select "Website" from the left menu on the Baota panel, then click "Add Site" or "Add General Project". Here, you need to fill in your website domain name, for examplewww.yourdomain.com.The root directory of the website can be kept as the default.When choosing a PHP version, since AnQiCMS is a Go language program and not a PHP application, you can choose "static" to avoid loading unnecessary PHP environments.In this step, there is no need to create FTP and database.
After the site is created, click the "Settings" button on the right side of the site. After entering the settings page, select the "Website Directory" tab, and change the running directory to the AnQiCMS installation path under./publicFolder, for example/www/wwwroot/yourdomain.com/public. This is because the static resources of the AnQiCMS program are stored in this directory by default.
Next, configure the pseudo-static rules or reverse proxy according to your Web server type (Nginx or Apache):
Nginx configuration:
In the site settings page, switch to the 'Static' tab.Clear existing content and paste the following Nginx rewrite rule.The rules serve the purpose of forwarding all requests to the AnQiCMS application listening on the local port (default 8001), while also handling direct access to static files.
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 =200 @AnqiCMS;
location / {
try_files $uri $uri/index.html @AnqiCMS;
}
Save these rules and restart Nginx to make it effective.
Apache Configuration:
If you are using Apache as a web server, you do not need to fill in anything in the 'pseudo-static' rules.You should find the 'Reverse Proxy' option in the site settings and enable it.http://127.0.0.1:8001. Save the configuration and restart the Apache service.
Start AnQiCMS application
Since we did not use the Baota Go project feature, we need to manage the start and stop of the AnQiCMS program through the system's built-in task scheduler.
In the installation directory of AnQiCMS (for example/www/wwwroot/yourdomain.com/), create two shell script files:start.shandstop.sh.
start.shThe content is as follows:
#!/bin/bash
### check and start AnqiCMS
# author fesion
# the bin name is anqicms
BINNAME=anqicms
BINPATH=/www/wwwroot/yourdomain.com
# check the pid if exists
exists=`ps -ef | grep '\<anqicms\>' |grep -v grep |wc -l`
echo "$(date +'%Y%m%d %H:%M:%S') $BINNAME PID check: $exists" >> $BINPATH/check.log
echo "PID $BINNAME check: $exists"
if [ $exists -eq 0 ]; then
echo "$BINNAME NOT running"
cd $BINPATH && nohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &
fi
Please note that you need toBINPATH=/www/wwwroot/yourdomain.comReplace with the actual installation path of AnQiCMS. If your AnQiCMS executable file name is notanqicms, it also needs to be modified accordinglyBINNAMEandgrepin the command name.
stop.shThe content is as follows:
#!/bin/bash
### stop anqicms
# author fesion
# the bin name is anqicms
BINNAME=anqicms
BINPATH="$( cd "$( dirname "$0" )" && pwd )"
# check the pid if exists
exists=`ps -ef | grep '\<anqicms\>' |grep -v grep |awk '{printf $2}'`
echo "$(date +'%Y%m%d %H:%M:%S') $BINNAME PID check: $exists" >> $BINPATH/check.log
echo "PID $BINNAME check: $exists"
if [ $exists -eq 0 ]; then
echo "$BINNAME NOT running"
else
echo "$BINNAME is running"
kill -9 $exists
echo "$BINNAME is stop"
fi
Similarly, modify according to your actual situationBINNAME.
Save these two scripts after, select the "Task Scheduler" from the left menu on the Baota panel. Add a scheduled task of type "Shell Scriptsh /www/wwwroot/yourdomain.com/start.sh(Please replace with your actual path). This task ensures that the AnQiCMS process can automatically restart after an unexpected stop.
To immediately start AnQiCMS, you can manually click the "Execute" button next to the "Start AnQiCMS" task in the scheduled task list.
Initialize AnQiCMS website
After completing all the above configurations, you can access the domain you have bound in the browser. If everything goes well, you will see the initialization installation interface of AnQiCMS.
On this screen, you need to fill in the previously prepared database information (database address, username, password, etc.), and set up your backend administrator account and password.After completing these steps, click the 'Install' button, AnQiCMS will complete the initialization and basic configuration of the database.
Access the AnQiCMS backend
After installation, the system will prompt you to enter the website's frontend or backend. The backend access address of AnQiCMS is usually您的域名/system/For example, if your website ishttp://www.yourdomain.com/Then the background address ishttp://www.yourdomain.com/system/.
When you first log in to the background, please be sure to change the default administrator account and password to enhance the security of the website. The default administrator account isadmin, and the default password is123456.
Now, you have successfully deployed AnQiCMS on the old Baota panel.You can start creating content, managing pages, optimizing SEO, and using the powerful features of AnQiCMS to enhance your website's operational efficiency.
Frequently Asked Questions (FAQ)
Q1: How should I operate if I want to deploy multiple AnQiCMS sites on the same server?
A1:When deploying multiple AnQiCMS sites on the same server, each AnQiCMS instance needs to listen on a separate port. You need to set up a separate port for each AnQiCMS installation directory underconfig.jsonIn the file, modifyportThe parameter is a different port number, such as 8002, 8003, and so on.At the same time, you also need to create independent website configurations for each site in the Baota panel, and modify the reverse proxy rules of Nginx or Apache, forwarding the domain requests of each to the port that the corresponding AnQiCMS instance is listening on.start.sh) where `BIN