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

Calendar 👁️ 99

AnQi CMS is an enterprise-level content management system developed based on the Go language, which is favored by small and medium-sized enterprises and content operation teams for its simple 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.

The process of deploying AnQiCMS Go project on Baota panel

Deploy AnQiCMS Go project on Baota panel, especially in version 7.9.3 and above, the operation process has been greatly simplified and optimized, fully utilizing the advantages of Baota panel's native support for Go language projects.

Firstly, you need to log in to Baota panel and ensure that the Docker service is installed (if you need to deploy using Docker). If you choose to directly deploy the executable file of AnQiCMS to the server, you need to create a dedicated directory for AnQiCMS in the file management, for example, in/www/wwwroot/Create newanqicms.comDirectory, upload and unzip the AnQiCMS Linux installation package to this directory.

Next, navigate to the "Website" function area on the left menu of the Baota panel, click the "Go project" option.Here, you will see the 'Add Go project' button. Clicking it will open a configuration window where you need to fill in the following key information:

  • Project executable file:Specify the complete path to the AnQiCMS executable file, for example/www/wwwroot/anqicms.com/anqicms.
  • Project name:Name a recognizable name for your AnQiCMS instance, such asAnQiCMS_Main.
  • Project port:Set the port that the AnQiCMS program listens to, the default is usually8001. If you plan to deploy multiple AnQiCMS instances, each instance needs to be configured with a non-conflicting port.
  • Execute the command:Please fill in the full path of the AnQiCMS executable file again, the Baota panel will use this command to start your Go application.
  • Run user:Generally, it is chosenwwwUser, to ensure that the program has the appropriate permissions.
  • Boot up:It is strongly recommended to check this option, so that the AnQiCMS service will automatically start after the server restarts, without manual intervention.
  • Bind domain:Enter the domain name you have resolved to the server.

After completing the above configuration and clicking submit, the Baota panel will automatically handle the deployment and startup of the AnQiCMS project.Later, you need to configure reverse proxy for the domain in the "Website" list of the Baota panel.Click the "Settings" of the corresponding domain name, go to the "Website Directory" and set the running directory to/public. Add proxy rules in the 'Reverse Proxy' to forward your domain traffic to the internal port that AnQiCMS is listening on (for examplehttps://en.anqicms.com)。Finally, by visiting your domain name through the browser, you can enter the AnQiCMS initialization installation interface and complete the database configuration and administrator account settings.

The analysis of PID management mechanism: Differences and similarities between Baota panel and AnQiCMS built-in scripts

The operation of AnQiCMS cannot do without process management to ensure its stability and availability. When deploying the AnQiCMS Go project in the Baota panel environment, its PID (Process ID) management mechanism is consistent with the one built into AnQiCMS.start.shandstop.shThe script has significant similarities and differences.

The Baota panel's PID management mechanism

When you deploy AnQiCMS through the "Go project" feature of Baota panel, Baota panel takes on the main process management responsibilities.It utilizes the underlying process management tools of the operating system (such as Systemd, Supervisor, or other daemon management schemes on Linux) to monitor, start, and stop the AnQiCMS process.

In this mode, the Baota panel will:

  • Automatically monitor processes:The Baota panel will continuously check the running status of the AnQiCMS process.If a process terminates unexpectedly, it will automatically try to restart according to the configuration (such as the "boot start" option) to maintain the continuity of the service.
  • Unified scheduling management:Users can easily perform operations such as starting, stopping, and restarting AnQiCMS through the graphic interface of the Baota panel.These operations are converted to corresponding system commands by the Baota panel, and users do not need to interact directly with the underlying process commands.
  • Isolation and resource management:The Baota panel can better manage the resource usage of AnQiCMS processes, such as allocating independent running environments for different Go projects to avoid resource contention.
  • Log integration:The Baota panel collects the runtime logs of Go projects and provides a unified view and management interface, which is convenient for users to troubleshoot issues.

In short, the Baota panel actually creates a regulated service for AnQiCMS when deploying a Go project.The identification and lifecycle management of PID is entirely handled by the backend service of Baota panel, it may not explicitly create and maintain PID files, but instead tracks Go projects through the system process table.

AnQiCMS built-in script (start.sh/stop.shThe PID management mechanism

Provided by AnQiCMSstart.shandstop.shThe script is designed for users who have not used Baota panel or other advanced process managers, or manually deployed AnQiCMS in the command line environment.These scripts interact directly with the operating system via shell commands to implement basic process management functions.

start.shThe main logic of the script is:

  1. Check process status:It usesps -ef | grep '\<anqicms\>' | grep -v grep | wc -lsuch command combinations to find the number of running processes namedanqicms.grep '\<anqicms\>'Used to match the process name accurately,grep -v grepexcludedgrepits own process,wc -lthen count the number of lines.
  2. Start the process:If detected,anqicmsThe process is not running (i.e.,exists -eq 0), the script will switch to the installation path of AnQiCMS (BINPATH),then usenohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &command to start the program.
    • nohupEnsure that the program continues to run even after the user exits the terminal.
    • >> $BINPATH/running.log 2>&1Redirect the standard output and standard error of the program torunning.logfile.
    • &Run the program in the background.
  3. Do not create a PID file:It is worth noting that these scriptsNoneExplicitly create and manage PID files. They are completely dependent onpscommands to find PID by process name.

stop.shThe logic of the script is:

  1. Find PID:It usesps -ef | grep '\<anqicms\>' | grep -v grep | awk '{printf $2}'to findanqicmsThe process's PID.awk '{printf $2}'Used to extract the PID column from the process list.
  2. Terminate the process:If the PID is found, the script will usekill -9 $existscommand to forcibly terminate the process.

Bycrontabcooperatestart.shA script that can implement a simple self-start and guard function to check and start AnQiCMS every minute, ensuring that the service can recover automatically after a crash.

Summary of similarities and differences

Similarities:

  • Core Objective:Both strive to ensure the continuous operation of the AnQiCMS application and start or restart it as necessary.
  • Basic Operations:Finally, the service is started by executing the AnQiCMS executable file compiled in Go language.

Differences:

  • Management entity:The Baota panel manages the AnQiCMS process through its built-in service management module (such as systemd integration), providing a high-level abstraction and visual interface. The AnQiCMS自带脚本 is a direct shell script, throughcrontabExecuted by the operating system itself.
  • Robustness and automation level:The Baota panel management mechanism is more robust and automated. It can more accurately monitor process status, handle various abnormal situations (such as port occupation, process僵死), and provide detailed logs and alarm functions.The robustness of the built-in script is relatively low, mainly relying on timed checks and brute forcekill -9Limited in handling complex exceptions.
  • PID recognition method:The Baota panel usually tracks the process PID in a more fundamental and systematic way when deploying Go projects. Andstart.sh/stop.shscripts go throughgrepandawkParsingps -efThis output method may have certain limitations and inaccuracy in extreme cases (such as server overload causingpsslow command response or process name conflicts.
  • User interaction:Baota panel provides a graphical interface for operations such as startup, stop, restart, etc., providing a better user experience. The built-in scripts require users to manually execute or configure through the command line.crontabScheduled task.
  • Multi-site management:The 'Go project' feature of Baota panel can elegantly manage multiple AnQiCMS instances, each instance can bind different ports and domains, which are scheduled by the panel. To manage multiple sites with the built-in script, a separate set of scripts needs to be copied for each site

Related articles

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

How to write a AnQiCMS monitoring script that not only checks PID but also detects if the port is listening normally?

As a senior AnQiCMS website operation personnel, I am well aware of the importance of maintaining system stability for content distribution and user experience.Our AnQiCMS, developed based on the Go language, is renowned for its high performance and stability, but any system may encounter unexpected problems in complex production environments.Therefore, a reliable monitoring mechanism is indispensable.

2025-11-06

What is the meaning of `PID check: 0` in the `check.log` after the AnQiCMS process exits abnormally?

As an experienced CMS website operation personnel of an enterprise, I know the importance of stable system operation for the content platform.In daily work, we often need to pay attention to various system logs in order to discover and solve potential problems in a timely manner.Among them, the `PID check: 0` record in the `check.log` file is a very critical signal when we are troubleshooting the abnormal process of AnQiCMS.

2025-11-06

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 to assist in troubleshooting the issue of AnQiCMS process PID not existing but the website is inaccessible by checking the system logs?

As an experienced CMS website operation person, I know the anxiety of the website being inaccessible but the process PID is not traceable.In this case, the system log is the key 'eye' for us to understand the root cause.The AnqiCMS is developed based on the Go language, its efficient and stable characteristics make it rarely encounter problems during normal operation, but when it does, it often means that the startup environment or external dependencies have issues.### Overview of AnQiCMS process startup mechanism AnQiCMS usually manages its processes through a startup script (such as `start.sh`)

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