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

Calendar 👁️ 55

As an experienced security CMS website operation person, I am well aware of the great value of multi-site deployment in content management and efficiency improvement.For the question you raised about the AnQiCMS multi-site deployment tutorial, how are the PIDs of different sites distinguished and managed?This question, I will elaborate on the mechanism of Anqi CMS design and actual 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.AnQi CMS provides two core multi-site deployment modes, and these two modes have significant differences in process management.

Multi-site deployment of an independent application instance

The first mode is to deploy an independent security CMS application instance for each site.Under this deployment method, each secure CMS instance runs independently on the server.Information mentioned in the "Frequently Asked Questions" section of the document: "Each AnQiCMS requires a port, the default port is 8001. If you want to install multiple AnQiCMS on the same server, you need to allocate a different port for each project, and the port is written in config.. Edit config. to define different ports.

This means that if you deploy three sites on the same server, for examplesiteA.com/siteB.comandsiteC.com:

  • You will deploy three independent Aiqi CMS program files.
  • Each program will be configured with an independent running port, for examplesiteA.comrunning on8001port,siteB.comrunning on8002port,siteC.comrunning on8003on the port.
  • Each independently running AnQi CMS application instance will have one in the operating systemIndependent PID.

In this mode, the operating system will assign a unique PID to each secure CMS process.When managing these processes, you can manage them like any other standalone application, by finding and operating on their corresponding PIDs through their port numbers or executable file names.The document also mentions how to use it in the "Common Errors During Installation"}lsof -i:{端口号}To find the PID of the process occupying a specific port and to usekill -9 {PID}To terminate the process, these are all operation methods for independent processes.

Manage multiple sites within a single application instance

The second mode is also the multi-site management mode recommended and built-in by AnQi CMS, which is to host multiple sites through a single AnQi CMS application instance.This method is particularly suitable for Docker deployment in integrated environments such as Baota panel or 1Panel, or for configuring Nginx/Apache reverse proxy via the command line.The chapter "Adding a secure CMS multi-site tutorial through reverse proxy" and "installing multi-sites on a single server" in the document describes this method in detail.

In this mode:

  • Only one security CMS core application is runningFor example, it may listen uniformly.8001Port. Therefore, at the operating system level,There is only one secure CMS process, corresponding to a single PID.
  • All external requests, whether accessingsite1.com/site2.comOrsite3.comIt will first go through a reverse proxy server (such as Nginx or Apache).
  • The reverse proxy server forwards traffic to the unique security CMS application at the backend based on the domain name (Host header)8001on the port.
  • The Anqi CMS application willdistinguish which site's request based on the domain name inside after receiving the requestIt determines the current site of the request by matching the request domain with the site information configured in the background "Multi-site Management" (including "site root directory" and "website address", etc.).
  • Site data (such as content, cache, database) is typically stored independently, isolated through the 'site root directory' and 'database name' specified when creating a new site.

In short, in this mode, the distinction and management between different sites is not achieved through the PID at the operating system level, but through collaboration at the following two levels:

  1. External (Reverse Proxy Layer): Responsible for routing requests from different domain names to the same AnQi CMS application.
  2. Internal (AnQi CMS Application Layer): The application itself recognizes the domain of the request and dynamically loads and processes the resources and data of the corresponding site according to the preset configuration.

The advantage of this deployment method lies in higher resource utilization and more centralized management, but it requires the correct configuration of reverse proxy and the internal logic of the security CMS to effectively distinguish and isolate data from different sites.

In summary, the distinction and management of PID in the multi-site deployment of Anqi CMS is a problem that varies according to the specific deployment strategy.Each independently deployed AnQi CMS instance has its own PID, while managing multiple sites through a single AnQi CMS application, all sites share the same PID of the AnQi CMS core process, and the distinction and management between sites are completed within the application and the reverse proxy layer.

Frequently Asked Questions

Q1: When managing multiple sites with a single secure CMS instance, will a failure in one site affect the others?A1: Yes, since all sites share the same safe CMS core application process, if this process crashes due to abnormal operation or code error of a site, it is theoretically affecting all sites hosted under this instance.To mitigate this risk, an enterprise CMS usually has a robust error handling mechanism, but the practice typically includes regular backups and monitoring, and considering the deployment mode based on business importance.

Q2: How to configure different runtime environments or Go program versions for different sites in the multi-site mode of a single security CMS instance?A2: In a single security CMS instance mode, all sites run on the same Go program version and the running environment it is in.If you need to use different versions of the Go program, independent Go environment configurations, or independent upgrades for different sites, you should adopt the 'multi-site deployment of independent application instances' mode, that is, deploy an independent AnQiCMS application for each site.

Q3: How does AnQi CMS ensure data isolation and security for different sites in the single instance multi-site mode?A3: The Anqi CMS ensures data isolation through clear site configuration.When adding a new site in the background, the system will require an independent "site root directory" and "database name" for each site.This means that the data storage (such as cache, uploaded files) and content database of each site are independent of each other.In addition, the permission management system will also make detailed divisions for administrators of each site, ensuring that administrators of different sites can only access and manage the data of their respective sites.

Related articles

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

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

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

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