As an experienced CMS website operation personnel for security, I deeply understand the great value of multi-site deployment in content management and efficiency improvement.For your question about 'How are different site PIDs distinguished and managed in the AnQiCMS multi-site deployment tutorial?'This question, I will elaborate on the design philosophy and actual operation of Anqi CMS in detail.
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.The Anqi CMS provides two core multi-site deployment modes, which have significant differences in process management.
Multi-site deployment of independent application instances
The first mode is to deploy an independent security CMS application instance for each site.Under this deployment method, each security CMS instance runs independently on the server.According to the information mentioned in the "Frequently Asked Questions" section of the document: "Each AnQiCMS needs to occupy a port, the default port is 8001. If you want to install multiple AnQiCMS on the same server, you need to assign a different port to each project. The port is written in config., and you can 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 security CMS program files.
- Each program will be configured with an independent running port, for example,
siteA.comrunning on,8001port,siteB.comrunning on,8002port,siteC.comrunning on,8003port. - Each independently running security CMS application instance will have a port in the operating system.Independent PID.
In this mode, the operating system assigns a unique PID to each security CMS process.When managing these processes, you can find and operate on their corresponding PIDs just like managing any other standalone application, by their port number or executable file name.lsof -i:{端口号}to find the PID of the process occupying a specific port, as well as the one that useskill -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, also recommended and built-in by Anqie CMS, is a multi-site management mode that manages multiple sites through a single instance of the Anqie CMS application.This method is especially 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 "Adding Secure CMS Multi-Site Tutorial" and "Installing Multi-Sites on a Single Server" sections in the document describe this method in detail.
In this mode:
- Only one security CMS core application is running. For example, it may listen uniformly
8001Port. Therefore, at the operating system level,there is only one security CMS process, corresponding to a single PID. - all external requests, whether to access
site1.com/site2.comOrsite3.comAll 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 requested domain (Host header)
8001port. - The Anqi CMS application willDistinguish which site's request internally based on the domain name of the requestIt determines the current site of the request by matching the request domain with the site information configured in the backend "Multi-site Management" (including "Site Root Directory" and "Website Address" etc.).
- The data (such as content, cache, database) of each site is typically stored independently, isolated by the 'site root directory' and 'database name' specified when creating a new site.
In short, in this mode, the "distinguishing and managing" between different sites is not achieved through the PID at the operating system level, but is completed through collaboration at the following two levels:
- External (Reverse Proxy Layer): Responsible for routing requests from different domain names to the same security CMS application.
- Internal (Security CMS Application Layer)The application itself identifies 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 correct reverse proxy configuration and that the internal logic of the security CMS can effectively distinguish and isolate the data of different sites.
In summary, the distinction and management of PIDs in the multi-site deployment of AnQi CMS is an issue that varies according to the specific deployment strategy.Each independently deployed security CMS instance has its own PID, and when managing multiple sites through a single security CMS application, all sites share the same PID of the security CMS core process. The distinction and management between sites are completed within the application and at the reverse proxy layer.
Frequently Asked Questions
Q1: When managing multiple sites in a single security CMS instance, will a failure of one site affect the others?
Q2: How to configure different running environments or Go program versions for different sites in the multi-site mode of a single security CMS instance?
Q3: How does AnQi CMS ensure data isolation and security across different sites in the single instance multi-site mode?A3: The A3 Secure CMS ensures data isolation through explicit site configuration.When adding a new site in the background, the system will require specifying 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 a detailed division for each site's administrator to ensure that administrators of different sites can only access and manage the data of their respective sites.