How to assist in troubleshooting the issue of AnQiCMS process PID not existing but the website is inaccessible by checking the system logs?

Calendar 👁️ 83

As a senior CMS website operation personnel of an information security company, I know the anxiety of the website being inaccessible but the process PID not being found.In this case, the system log is the key 'eye' to uncovering the root of the problem.The Anqi CMS is developed based on Go language, its high efficiency and stability make it rarely have problems during normal operation, but once it does, it often means that the startup environment or external dependencies are in trouble.

AnQi CMS process startup mechanism overview

AnQi CMS usually starts through a startup script (such asstart.shTo manage its processes. The core function of this script is to check if the AnQiCMS main program is running, and if not, try to start it and redirect its output to a log file.Under Baota panel and similar environments, this script is usually configured as a scheduled task (cron job), executed once a minute to ensure the robustness of the website process.When the website is inaccessible, and throughps -ef | grep anqicmsWhen the command cannot find the process ID of AnQiCMS, we should first suspect that the AnQiCMS program has not started successfully, or it exited abnormally soon after startup.

Core troubleshooting approach

We need to systematically check from the outside to the inside to solve such problems.Firstly, confirm that the AnQiCMS program itself can run normally, then check its runtime dependencies, and finally examine the network configuration.Log files are the most valuable clues in this process, recording all kinds of events during program execution, including error messages.

Detailed troubleshooting steps for system logs

When the PID of AnQiCMS disappears and the website cannot be accessed, the following steps should be taken to view the relevant logs:

Confirm AnQiCMS process status

Although we have already discovered a missing PID, it is necessary to confirm again. Log in to the server and execute the following command:

ps -ef | grep anqicms

If there is no output or the output does not contain the main process information of AnQiCMS, then it can be definitely confirmed that the AnQiCMS process is indeed not running.If you see the process but the website still cannot be accessed, it may be a problem with port listening or reverse proxy, but currently we are focusing on the case where the process does not exist.

Check the startup script log

AnQiCMS's startup script, such asstart.shwhich usually records its execution status. In the installation documentation, we seestart.shit will write logs tocheck.logandrunning.log.

  • check.log: This file usually recordsstart.shThe script checks the process status of AnQiCMS each time it is executed by cron. By checking this file, you can understandstart.shWhether it is working normally, and whether it has ever tried to start AnQiCMS.tail -f /www/wwwroot/anqicms/check.log(Assuming the path of AnQiCMS)
  • running.logThis is the standard output and standard error log of the AnQiCMS application.If AnQiCMS attempts to start but fails, or crashes after startup due to a fatal error, the error information is often here.This is the golden position for troubleshooting internal application errors.tail -f /www/wwwroot/anqicms/running.log

Read carefullyrunning.logcontent. Common reasons for startup failure include:

*   **端口冲突**: AnQiCMS尝试监听的端口(例如8001)可能已被其他程序占用。
*   **数据库连接失败**: 数据库服务未启动,或AnQiCMS的配置(`config.json`)中数据库连接信息不正确。
*   **文件权限不足**: AnQiCMS程序或其依赖的文件(如模板文件、数据目录)没有正确的读写执行权限。
*   **配置错误**: `config.json`中的关键配置项有语法错误或值不合法。
*   **内存或CPU不足**: 系统资源耗尽导致程序无法正常启动或运行。

Analyze AnQiCMS application internal logs

exceptrunning.log,AnQiCMS in more detailed error scenarios may also write error logs to specific files (if configured).Although the document does not explicitly mention, in practice, Go applications may have more granular log configuration. Ifrunning.logThe information is insufficient to locate the problem, you can look for other files ending with in the AnQiCMS installation directory,.logor by checkingconfig.jsonFile, find where the log path and level are configured.

View system-level logs

If the above application-level logs do not explicitly indicate the problem or show that the program has exited due to external environmental issues, you need to check the system-level logs.

  • For usingsystemdManaged service (for example, if you configure AnQiCMS as a system service):systemctl status anqicms(Replace)anqicmswith your service name)journalctl -u anqicms -xe(View detailed service logs) These commands will display detailed information about service start, stop, crash events, as well as system errors that may cause crashes.

  • For general Linux system issues:dmesg: Displays kernel ring buffer information, may include low-level errors related to hardware, memory, disk I/O, etc.var/log/syslogor/var/log/messagesSystem general log, records system events, service status, etc., and sometimes can find other program exceptions or system resource alarms.

Check reverse proxy log

AnQiCMS is usually deployed after Nginx or Apache and other reverse proxies.If the AnQiCMS process is not running, the reverse proxy cannot connect to it naturally.Check the error log of the reverse proxy to confirm this.

  • Nginx: Error logs are usually located/var/log/nginx/error.log. If AnQiCMS is not running, you might see something similar toconnect() failed (111: Connection refused) while connecting to upstreamThe error indicates that Nginx cannot connect to the port being listened to by AnQiCMS.
  • Apache: Error logs are usually located/var/log/apache2/error.logor/var/log/httpd/error.logSimilarly, it will display an error indicating that the connection to the backend Go application has failed.

The access log of the reverse proxy (access.log) can also help us understand if there are external requests reaching the server, as well as the HTTP status codes received by these requests (for example, 502 Bad Gateway).

Verify port occupancy situation

Port conflict is a common cause of startup failure for Go applications. AnQiCMS listens on port 8001 by default. Use the following command to check if the port is occupied:

lsof -i:8001

If the command has output, it means that port 8001 is being occupied by a process. You cankill -9 {PID}command to terminate the process occupying the port. Then try to manually start AnQiCMS and observerunning.log.

check file permissions

Ifstart.shthe script cannot be executed, or the main program of AnQiCMS (anqicmsExecutable file does not have execution permissions, the program cannot start naturally.

  • Check the file permissions of the AnQiCMS installation directory:ls -l /www/wwwroot/anqicms/(Assuming the path of AnQiCMS)
  • EnsureanqicmsExecutable file has execution permissions (x) and wwwThe user (or the user you configure to run) has read and write permissions on the AnQiCMS installation directory and its subdirectories. If the permissions are incorrect, you can usechmod +x anqicmsTo grant execution permissions, and usechown -R www:www /www/wwwroot/anqicmsChange the owner.

Summary and suggestions

Through the above systematic log troubleshooting, we can usually locate the specific cause of the AnQiCMS process PID not existing but the website being inaccessible.The key is to analyze each log file patiently and meticulously, linking them together as clues.Establishing a habit of regularly checking logs can help us discover and resolve issues before they expand.

After the issue is resolved, be sure to manually execute the AnQiCMS startup script and continue to observe.running.loga few minutes, ensure the program runs stably without any new error logs.If AnQiCMS is managed by a scheduled task or system service, it is also necessary to ensure that these management mechanisms are configured correctly and can automatically restart AnQiCMS after a process crash.


Frequently Asked Questions (FAQ)

Q1: I checked.running.logWhat does the error message "address already in use" mean?

A1: This error usually means that AnQiCMS is trying to listen on a port (such as the default 8001) that is already occupied by another program on the server. You need to uselsof -i:{端口号}commands (for examplelsof -i:8001To find the process occupying the port, then terminate the process or modify AnQiCMS'sconfig.jsonFile, change the port number to an unused port and restart AnQiCMS.

Q2: I foundstart.shThe script seems not to have been executed,check.logWhat is this new record?

A2: Ifstart.shThe script was not executed, which may be due to a problem with the configuration of its scheduled task (cron job). You need to check if the server's cron configuration is correct, for example, on a Linux system, you can access it bycrontab -lCheck the current user's scheduled task list. Make sure the task path, execution user, and execution frequency are set correctly, and the cron service itself is also running normally.Sometimes, environmental variable issues may also cause cron tasks to not be foundstart.shscript.

Q3:running.logIs there any other possibility, as the database connection failed to display, but I am sure that the database service is running and the password is correct?

A3: In addition to the database service not being started or a password error, a database connection failure may also be caused by the following reasons:

1.  **数据库配置的IP地址或端口不正确**:确保AnQiCMS的`config.json`中数据库的`Host`和`Port`指向正确的数据库服务器地址。
2.  **数据库用户没有从AnQiCMS服务器IP连接的权限**:某些数据库(如MySQL)会限制用户只能从特定的IP地址连接。你需要检查数据库的用户权限设置,确保AnQiCMS运行的服务器IP地址在允许连接的范围内。
3.  **防火墙阻止了AnQiCMS与数据库之间的通信**:服务器的防火墙可能阻止了AnQiCMS的出站连接或数据库服务器的入站连接。检查并配置防火墙规则以允许AnQiCMS访问数据库端口(例如MySQL的3306端口)。

Related articles

In the AnQiCMS multi-site deployment tutorial, how is the PID of different sites distinguished and managed?

As an experienced security CMS website operator, I fully understand the great value of multi-site deployment in content management and efficiency improvement.Regarding your question about how different site PIDs are distinguished and managed in the AnQiCMS multi-site deployment tutorial?This question, I will elaborate on the mechanism of Anqi CMS design concept and practical operation for you.In the multi-site deployment scenario of AnQi CMS, distinguishing and managing the PID (Process ID, process ID) of different sites mainly depends on the deployment method you adopt

2025-11-06

How does the Baota panel's Go project deployment method differ from the PID management mechanism of the AnQiCMS built-in script?

AnQi CMS is a corporate-level content management system developed based on the Go language, which is favored by many small and medium-sized enterprises and content operation teams for its easy deployment, security and efficiency.In the Linux server environment, Baota panel, as a widely popular server operation and maintenance tool, provides great convenience for the deployment of AnQiCMS.This article will discuss in detail how to deploy the AnQiCMS Go project on the Baota panel, and analyze the similarities and differences in its PID management mechanism and the scripts provided by AnQiCMS.### Panel deployment of AnQiCMS Go

2025-11-06

How to ensure that the process keeps running after the system restarts when deploying AnQiCMS manually in the command line, by adding `start.sh` to `crontab`?

As an expert in the operation of Anqing CMS, I fully understand the importance of stable system operation for content management, especially under complex and changing server environments.For users who manually deploy AnQiCMS via the command line, ensuring that the service can automatically recover after system restart is a critical link in ensuring the continuous online operation of the website.The following will elaborate on how AnQiCMS achieves this goal through the collaborative work of `crontab` and `start.sh` scripts.

2025-11-06

What impact will there be on the PID management if `cd $BINPATH` fails when AnQiCMS starts?

As an experienced CMS website operation person in an enterprise, I am well aware of the importance of system stability for content release and user experience.AnQi CMS as an efficient Go language content management system, its startup mechanism, especially PID management, is a key link to ensure the service is online continuously.When the `cd $BINPATH` command in the startup script fails, it will cause a cascade effect on the subsequent process ID (PID) management, which in turn will affect the normal operation of the entire CMS.The startup script of AnQi CMS, such as the `start.sh` mentioned in the document

2025-11-06

What is the role of `>>> $BINPATH/running.log 2>&1` in the AnQiCMS startup script, is it related to the process PID?

As an expert in AnQiCMS (AnQiCMS) operation, I know the importance of every system detail for the stable operation of the website.Every step in the startup script is crucial, as it directly affects whether the service can start normally and whether we can quickly locate and resolve issues when problems arise.Today, let's delve into the actual function of the command `>> $BINPATH/running.log 2>&1` in the AnQiCMS startup script, as well as its relationship with the process PID.### AnQiCMS

2025-11-06

If the AnQiCMS process starts and the PID file is not generated, what configuration error might it be?

In the daily operation of AnQiCMS, we deeply understand that a stable running content management system is the foundation of business success.When you find that the AnQiCMS process has started, but the expected PID file has not been generated, this often indicates that the AnQiCMS service itself has not started successfully or has terminated unexpectedly.

2025-11-06

Why does AnQiCMS recommend using `kill -9` to terminate processes instead of a gentler signal?

As an experienced security CMS website operator, I am well aware of the importance of system stability and content security to the company.In daily maintenance, process management is an indispensable part.Recommend using `kill -9` to terminate the process for AnQi CMS instead of a gentler signal, which is due to considerations of system characteristics and operational efficiency.AnQi CMS is an enterprise-level content management system developed based on the Go language.Go language is known for its efficient concurrency handling capabilities and the single static binary file characteristic after compilation.

2025-11-06

How to ensure that the PID of the AnQiCMS process is not reused after system restart or failure?

As an experienced CMS website operation person in a security company, I know the importance of system stability and reliability for a content platform.In daily operations, ensuring the normal operation of core processes and effectively managing their lifecycle is the foundation for ensuring that the website continues to provide services to the outside world.

2025-11-06