As an experienced website operation expert, I have been dealing with AnQiCMS (AnQi Content Management System) in my daily work for several years, and I am well aware of its efficiency and simplicity.However, even the most powerful system is bound to encounter problems of "not fitting inWhen AnQiCMS fails to start on time and the website goes offline, how can we calmly and calmly analyze its shutdown state or error logs, quickly locate the problem and solve it?

This article will combine my in-depth understanding and practical experience of AnQiCMS, and provide you with a set of effective troubleshooting ideas and methods.

Understanding the startup mechanism of AnQiCMS

Before we delve deeper, we first need to have a basic understanding of the startup process of AnQiCMS. AnQiCMS is developed in Go language, and its core is a compiled executable file (usually namedanqicms)。In the Linux environment, to ensure the stable operation and automatic recovery of the program, we usually work with shell scripts (such asstart.shandstop.sh)and schedule tasks(cron job)to manage it.

start.shOne of the main responsibilities of the script is to checkanqicmsProcess is running, if not, it will start it in the background and redirect the standard output and error output to the log file.Therefore, these log files will be our 'treasure map' for troubleshooting.

The first step in troubleshooting: confirm whether AnQiCMS has really “stopped”

When your website is inaccessible, the first thing to confirm is whether AnQiCMS is really stopped running, or if it is just a front-end access path or network issue.

  1. Check website access:Attempt to directly access your website.If the return is 502 Bad Gateway, 504 Gateway Timeout, or simply a connection timeout, it is very likely that AnQiCMS is not working properly.
  2. Check the process status:On the server command line interface, use the following command to check if the AnQiCMS process is still running:
    
    ps -ef | grep anqicms
    
    If you see something similaranqicms 7621 ...in the output, where7621It is the process ID (PID), indicating that the program may still be running, but there is a problem with external access. If there is no output, then AnQiCMS has indeed stopped.
  3. 检查端口占用:EnglishAnQiCMS默认运行在8001端口(可配置)。Even if the process does not exist, the port may be occupied by another program, which causes AnQiCMS to fail to start.lsof -i:{端口号}[for example]lsof -i:8001)You can check the port usage. If the port is occupied, you will see a PID indicating that another program is using the port.

核心:错误日志,你的“调查”线索

Once confirmed that AnQiCMS fails to start normally, or the service is abnormal although the process exists, then the error log is our most important "detective" clue. According to the AnQiCMS startup script convention, there are usually several key log files:

  1. running.log:This is the operation log of the AnQiCMS application itself. All standard output and error information of the program, including the reasons for startup failure, will be recorded here.
  2. check.log:This isstart.shScript execution process check log, which records the execution status of the script, such as when AnQiCMS is found not running and attempts to start.

How to view the log file?

The logs are usually located in the installation directory of AnQiCMS. You can usetailto view the latest log output in real time, or usecat/lessto view the complete content:

  • Real-time trackingrunning.log: tail -f /path/to/anqicms/running.log(Replace/path/to/anqicmsReplace it with your AnQiCMS installation path)
  • Viewcheck.log: cat /path/to/anqicms/check.log

What to look for in the log?

When you view the log, please pay attention to the following keywords and phenomena:

  • error/failed:These are obvious error messages, which usually point directly to the problem.
  • panic:Common severe errors in Go language programs that can cause program crashes.
  • connection refused/access denied:Database connection failure is a common prompt, usually related to database configuration, account password, or database service status.
  • permission denied:Insufficient file or directory permissions, the program cannot read or write the required resources.
  • address already in use:Port is already in use, the program cannot bind to the specified port.
  • no such file or directory:It may be that the path of a configuration file, template file, or executable file is incorrect or missing.

Common startup failure scenarios and solutions

Combine the clues from the log, we can target the problem.

  1. Port conflict (address already in use)
    • Symptoms: running.logAn error such as 'address already in use' or similar occurs.
    • Analysis:The default port 8001 may be occupied by other programs.install.mdandstart.mdIt was mentioned in all of them.
    • Solution:
      • Uselsof -i:8001Find the PID of the process occupying port 8001, then usekill -9 PIDto terminate the process.
      • Modify the AnQiCMS'sconfig.jsonfile, and change the one in theportConfiguration item changed to an unused one