AnQICMS Installation Tutorial

Supported systems

Supports Windows 7, Windows 8, Windows 10, Windows 11, and Windows server versions. Windows XP not tested
Supports X86-based Linux versions, such as Ubuntu, Centos, Red Hat, Debian, etc.
Supports MacOS.

Deploy AnQiCMS on Linux Server

From first/downloadDownload the AnQiCMS Linux installation package.



Deployment on pagoda

First installation:

The Baota Panel version 7.9.3 or above supports faster deployment. It is recommended to upgrade the Baota Panel to the 7.9.3 or above.

Create a directory and upload an installation package
1.Click on the menu on the left文件Menu, switch directory to/www/wwwroot/Directory, inwwwrootCreate a new directory under the directory, which is generally named after the domain name, such asanqicms.com. As shown in the picture:



2.Clickanqicms.com,Enteranqicms.comFolder, install Linux packageanqicms-linux-v3.x.x.zipUpload to the current directory. Installing the packageanqicms-linux-v3.x.x.zipRight-click on the top and select Unzip to unzip the installation package to the current folder. As shown in the picture:



Pagoda Panel version 7.9.3 or above deployment:

Click on the menu on the left网站Menu, clickGo项目, come to the Go project website creation page, click添加Go项目button, configure it in the pop-up window that pops up. Project execution file selection/www/wwwroot/anqicms.com/anqicms;Fill in the project nameAnQICMS; Project port Fill in8001;Execute the command to fill in/www/wwwroot/anqicms.com/anqicms; Run user selectwww; and check the startup, and you can fill in the notes as needed, as default; bind the domain name to fill in the domain name you parsed to the server. After filling in, click the Submit button to complete the addition. As shown in the picture:




Deploy in the old version of the pagoda:

If the old version does not use the Go project deployment, select another project deployment.

Click on the menu on the left网站Menu, click其他项目, go to the creation page of other project websites, click添加通用项目The button is configured in the pop-up window. The configuration items are the same as the contents of the Baota version 7.9.3 or above. Project execution file selection/www/wwwroot/anqicms.com/anqicms;Fill in the project nameAnQICMS; Project port Fill in8001;Execute the command to fill in/www/wwwroot/anqicms.com/anqicms; Run user selectwww; and check the startup, and you can fill in the notes as needed, as default; bind the domain name to fill in the domain name you parsed to the server. After filling in, click the Submit button to complete the addition.


Initialize the installation website
In the browser, access the domain name you bind, go to the AnQICMS initialization installation interface, fill in the database information, backend account password information, and website address. As shown in the picture:



If the installation fails, possible situations include: 1. The database account password is incorrect. Please recheck the database account password. 2. The database account permissions are insufficient and the database cannot be created. Please create the database in advance or use an account with higher privileges. 3. The administrator password length is insufficient, please set a more complicated password.

After the installation is successful, visit the foreground and background to check whether everything is normal.

If the installation fails, possible situations include: 1. The database account password is incorrect. Please recheck the database account password. 2. The database account permissions are insufficient and the database cannot be created. Please create the database in advance or use an account with higher privileges. 3. The administrator password length is insufficient, please set a more complicated password.

After the installation is successful, visit the foreground and background to check whether everything is normal.

Install multiple sites on one server:

AnQiCMS Installing multiple sites on a server does not require copying multiple AnQICMS codes. Please follow the following procedure to add multiple sites.

1.In the menu on the left side of the Pagoda panel, click网站Menu, clickPHP项目, add a PHP site. In the creation site, fill in the domain name that has been resolved to the server. Press the root directory to default. Copy the root directory address. I will use it in the next step. Choose not to create both FTP and database, and choose pure static version. Finally click Submit. As shown in the picture:



2.Log in to the site background and click on the menu on the left.多站点管理Menu (only the default installed sites have multi-site administration permissions). In the multi-site management interface, click the Add New Site button. In the pop-up window that pops up, fill in the form according to the actual situation. Fill in the site name according to the actual situation to facilitate the distinction between different sites; please fill in a new directory for the site root directory and paste the site root directory copied in the first step, such as:/www/wwwroot/study.ykbh168.com, the new directory needs to be created on the server in advance; fill in the new URL in the site URL, and this URL needs to be parsed on the server in advance. The administrator account and administrator password are the administrator account passwords of the new site; the database name needs to be a new database. Do not fill in the database of the existing site, otherwise it will cause data overwrite. If the default installation is installed using the root account, you can choose to reuse the database account to avoid filling in the account information. Finally, click the OK button to complete the creation of the new site. As shown in the picture:



3.In the pagoda, click Settings in the newly created website operation bar, and in the pop-up interface, select网站目录Menu, change the run directory to/public, click Save. As shown in the picture:



4. Pseudo-static settings
- Nginx pseudostatic settings
choose伪静态Menu, fill in pseudo-static rules and click Save. You can click Save as a template for the next time:
    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;
    }


- Apache pseudo-static configuration
If you use Apache software, pseudostatic rules will be inconsistent. Please leave the pseudo-static column blank, select the reverse proxy, and fill in the target URL.http://127.0.0.1:8001/, as shown in the picture:



This way, the new site is added.

Default config.json configuration:

{
	"server": {
		"site_name": "安企内容管理系统(AnqiCMS)",
		"env": "production",
		"port": 8001,
		"log_level": "release"
	}
}

Deploy and install AnQiCMS from the command line

If your server does not have visual environment management software installed, uselnmp.orgThe LNMP one-click installation package environment, or a self-compiled server environment, including local Linux desktop versions, such as Ubuntu, CentOS desktop versions, etc., can be deployed using commands. By default, the following operations believe that you have installed the LNMP environment.

1.Download the Linux version of AnQiCMS installation package from the official website and extract the installation package to the specified location. Assume that decompression/www/wwwroot/anqicms.comTable of contents.

2. Add a startup schedule task:

crontab -e


In the editing interface that opens, add a command

*/1 * * * * /www/wwwroot/anqicms.com/start.sh
# ws 保存并退出。


Note here that if you manually modify the anqicms executable file name, you need to manually open start.sh editing and change the anqicms inside to the corresponding new file name.

After adding the scheduled task, execute it again:

./start.sh


3. Configure the Nginx site
Generally speaking, you also need to configure nginx proxy to use port 80 or https port. The following is an example of the configuration of the site and directory as /www/wwwroot/anqicms.com and the domain name dev.anqicms.com:

We need to configure the website's running directory, that is, the root directory of nginx to the public directory under the site directory.

And set the reverse proxy, target URL:http://127.0.0.1:8001/

The nginx proxy code is as follows:

    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;
    }


Complete nginx configuration:
server
{
    listen       80;
    server_name www.anqicms.com m.anqicms.com;
    root /www/wwwroot/anqicms.com/public;

    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;
    }
    access_log access.log;
}
The nginx settings are completed, restart nginx to make the configuration take effect.

4. Multi-site configuration
You only need to repeat the third step above. There are only two places that need to change, namely server_name and root. Server_name fill in the new domain name and root fill in the new site root directory.
After adding the Nginx site, go to the AnQiCMS backend multi-site management and add the corresponding site.

Upgrade from AnQiCMS 2.x to 3.x

Since the AnQiCMS 2.x version of the server installation and deployment tutorial is relatively complicated, it is easy to cause some problems, and ordinary users cannot troubleshoot and solve them themselves. Moreover, the 2.x version does not support the background restart function, it is recommended to upgrade to the 3.x version here. The upgrade method is as follows:

1. Select the first installed site as the default site, log in to the website background, and upgrade from the background to the latest version. After the upgrade is completed, the site will be restarted through the original planned task. If the background version is not updated to a new version after trying to restart, you can use the ending FAQ method to solve it.

2. First use the planned task to stop the project, and then delete the planned task.

3. Press the deployment method of Baota Panel 7.9.3 or above to start adding it as a Go project. When adding a project, the execution file selected is the anqicms executable file of the first site, and the port is the port of the first site. After adding the project, you can restore website access. The initialization step will not be entered.

4. If you have already installed multiple sets of AnQiCMS on the server, you now need to stop them all in the scheduled tasks and then delete the scheduled tasks. Then, deploy it into a new site by installing multiple sites on one server. Note that when adding a new site, the root directory of the site you fill in is the original root directory of the site, and the database information is the original database and account information of the site. In this way, it will automatically inherit the data of the original site and will not enter the initial installation step.

The above method can combine multiple sites into deployment management using one AnQiCMS. The above changes will not affect actual use.

Testing with AnQiCMS on Windows

On Windows, you can test using AnQiCMS and do local development and debugging. On Windows, it is also recommended to install the Baota Software management environment, or install the phpStudy software development environment.

Download the Windows version installation package from the official website and put it in any directory. Unzip it into the specified folder, for example, unzip it to the anqicms folder, enter the folder, double-click to run the anqicms.exe file, and you can use it for testing. If you need to run multiple sites locally, you need to cooperate with Baota Software or phpStudy software to add multiple sites through the website menu of its management interface, and add pseudostatic rules to pseudostatic rules. Pseudostatic rules can be added in the pseudostatic settings. The local test domain name needs to be written to hosts.

How to Stop or Turn Off AnQiCMS on Windows
To turn off AnQiCMS on Windows, you need to use the task manager that comes with Windows.
Press Win key + R to call up the Run window, enter taskmgr to open the Task Manager, or in the taskbar, right-click and select Task Manager. In Task Manager, find anqicms.exe and click the End button to end it.

Testing with AnQiCMS on MacOS

AnQiCMS can be tested on MacOS and used for local development and debugging. On MacOS, you need to install MySQL and Nginx environments first.

Download the MacOS version installation package from the official website, put it in any directory, decompress it, and double-click the anqicms file in the running directory to test it. Multi-site testing method can be implemented by deploying and installing the AnQiCMS method on the command line. You need to write the domain name to /etc/hosts first.

Common errors during installation

1. The port has been occupied.
When multiple anqicms are installed repeatedly on the server, the port may be occupied. If it is set, but the website is not accessible, this may be the reason.
Under Linux, use the following command lsof -i:{port number} to view the port status. To find out whether the 8001 port is occupied:

lsof -i:8001


After finding the occupied PID, end it by killing -9 {PID}.
kill -9 7621


2. The pseudo-static rules are set incorrectly.