lnmp refers to installing Nginx+MySQL+php environment on a Linux server.
The installation of lnmp can be done using a one-click installer:https://lnmp.org/you can also install them individually. The installation of lnmp is not covered here. This tutorial assumes that you have already installed the lnmp environment.
Open the terminal, connect to the server, 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 file, unzip it, and rename the anqicms file to anqibin1. Remember, the name of the executable file cannot be the same as the directory.
Create a config. file, specify 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 up automatic error detection and restart plan
The independent installation steps of multiple sites are roughly the same as those 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, such as anqitest2, in the wwwroot directory of the server (please change the actual directory according to your needs)
Unzip the package into the anqitest2 folder, rename the anqicms file to anqibin2, remember, the execution file name cannot be the same as the directory
Create a config. file, specify the port, such as 8002
if ($host ~ '^anqitest.com'){
return 301 http://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 up automatic error detection and restart plan
Scenario one, generally the program has already started
In this case, we need to check the port status first, the command to use is:lsof -i:{端口号}For example, if the port is 8001, the command islsof -i:8001You can see the program ID occupying the port, and then use the kill command to terminate the processkill -9 {进程ID}For example, if the process ID is 70049, the command iskill -9 70049If multiple process IDs are detected, you can terminate them individually, or separate them with spaces, such askill -9 70049 70050
You can also find the running status by checking the executable file, the command is: pidof {执行文件名}For example, if the executable file name is anqibin1, the command ispidof anqibin1It will list the process ID, and use the same kill command to terminate the process.
If using the above two commands does not find the process ID, it means 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 is changed, then the anqicms database configuration file needs to be changed accordingly, otherwise the program cannot start normally.
Edit the config. in the root directory, modify the database information corresponding to the mysql field, change it to the correct program, and then start it.
Generally, this is caused by not specifying the execution filename correctly. Please carefully check and change the execution filename.
It is usually because https has been enabled, but the URL has not been changed to https in the global settings of the background.