lnmp refers to installing the Nginx+MySQL+php environment on a Linux server.

The installation of lnmp can be done using a one-click installation package:https://lnmp.org/Also, you can install them individually. The installation of lnmp is not covered in this tutorial. This tutorial assumes that you have already installed the lnmp environment.

Single-site installation steps
Open the terminal, connect to the server, and create a new file in the wwwroot directory of the server (please change the directory according to your actual directory), such as anqitest

Download the latest anqicms installation package from the official website to a new folder, unzip it, and rename the anqicms file to anqibin1. Remember, the name of the executable file cannot be the same as the directory name.

Create a config. file, specifying the port, such as 8001

Add site information to the Nginx configuration file

Add top-level domain redirection to www domain configuration

Start anqicms

Set automatic detection of errors and restart schedule

Independent installation steps for multiple sites
The independent installation steps of multiple sites are roughly the same as the installation steps of a single site, but there are two things to note: one is that the port cannot be duplicated, and the other is that the running file name cannot be duplicated.

Create a new file under the wwwroot directory of the server (please change the actual directory according to your needs), such as anqitest2

Extract the installation package to the anqitest2 folder, and rename the anqicms file to anqibin2. Remember, the name of the executable file cannot be the same as the directory

Create a config. file, specify the port, such as 8002

if ($host ~ '^anqitest.com'){
return 301http://www.anqitest.com/$request_uri;
}
Add site information to the Nginx configuration file

Add top-level domain redirection to www domain configuration

Start anqicms

Set automatic detection of errors and restart schedule

Common error handling
Cannot start, the port is already in use
Scenario one, usually the program has already started

In this case, we need to check the port status first, the command used is:
lsof -i:{port number}, for example, if the port is 8001, the command is lsof -i:8001, which can display the program ID occupying the port, then use the kill command to terminate the process
kill -9 {Process ID}, if the Process ID is 70049, the command is kill -9 70049, if multiple Process IDs are detected, they can be killed separately, or separated by spaces, such as kill -9 70049 70050

Also, you can find the running status by checking the executable file, the command used is:
pidof {execution file name}, such as the execution file name is anqibin1, then the command is pidof anqibin1, which will list the process ID, and use the same kill command to terminate the process.

If the process ID is not found using the above two commands, it means that the program has not started, and the error may be caused by other reasons.

Scenario two, the MySQL account password is incorrect

If the server is migrated or the database account password has changed, then the anqicms database configuration file needs to be correspondingly changed; otherwise, the program cannot start normally.

Edit the config. in the root directory, modify the mysql field to correspond to the database information, change it to the correct program, and then start.

Automatically detect that the scheduled task execution is abnormal
This is usually caused by not specifying the execution file name correctly. Please carefully check and change the execution file name.

Sitemap is displaying incorrectly
This is usually because https has been enabled, but the URL has not been changed to https in the global settings on the backend.