As an expert in AQ CMS content management and website operation, I fully understand the value of efficient multi-site management.The multi-site management function of AnQi CMS is specifically designed to meet this core requirement, allowing for the management and operation of multiple independent websites on a single server with a streamlined and efficient architecture.This greatly improved the operational efficiency and effectively integrated resources.
Understanding the multi-site architecture of AnqiCMS
A safe CMS does not require the installation of a separate program for each website. Its multi-site management core lies in, throughan instance of a core applicationTo bear and manage multiple independent logical sites. This means that you only need to run one security CMS process on the server, usually listening to an internal port (such as 8001).When external requests access through different domains, the server's front-end web server (such as Nginx or Apache) will forward these requests to this single secure CMS application instance.The Anqi CMS then identifies the corresponding logical site based on the requested domain from its internal configuration and database, and provides the corresponding website content.
The advantages of this architecture are obvious:
- Resource-efficient utilizationAvoided the waste of resources caused by deploying multiple sets of programs repeatedly, reducing the hardware overhead of the server.
- Unified centralized managementAll site management functions are centralized in one background, simplifying daily maintenance and operation processes.
- Simplify upgrade maintenance: The upgrade of the core program only requires one operation, which benefits all managed sites and greatly reduces maintenance workload.
- Balance of data sharing and isolation: Although the underlying system is the same, each logical site has an independent database and file storage space, ensuring data isolation and also facilitating cross-site data sharing and resource integration when needed.
The operation process of installing and managing multiple sites on a server
To implement multi-site management of the Anqi CMS on a single server, the following is a detailed operation process based on panel tools (such as Baota Panel, 1Panel), which is the most commonly used method by operation personnel:
First, make sure that a secure CMS core instance has been successfully installed and running on your server. This instance is usually bound to your main domain name or a test domain via reverse proxy and runs on a default port (for example8001)
The first step: Create a domain entry for the new site in the server panel
For each new site you want to add, you need to create an independent "website" or reverse proxy entry for it in the server management panel (such as Baota panel or 1Panel).
For example, using Baota panel, you can create a new "PHP project" or a reverse proxy site, even if your AnQiCMS is a Go language application.The key is that you need to bind an independent domain name for the new site and set the target address of the reverse proxy to the internal port of the AnQiCMS core instance you are running.For example, if your AnQiCMS core instance is running on127.0.0.1:8001Then the reverse proxy target of the new site should also be set tohttp://127.0.0.1:8001.
In this step, you will specify the domain name of the new site, for examplenewsite.com. Although Baota may require you to set a 'root directory', this directory is mainly used for panel display and Nginx/Apache configuration, and later we will specify the actual site data storage directory in the Anqi CMS background.
Step 2: Configure the Nginx/Apache reverse proxy rules for the new site
After creating the domain entry, it is necessary to configure the reverse proxy rules for Nginx or Apache for the new site to ensure that requests from the new domain can be correctly forwarded to the core application of the Anqi CMS.
For Nginx, you need to change the 'runtime directory' in the configuration of the new site to/public(If using Baota panel, this is usually a separate setting item), then add the following reverse proxy rules as shown:
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 =200 @AnqiCMS;
location / {
try_files $uri $uri/index.html @AnqiCMS;
}
These rules indicate Nginx: first try to find the requested static file(try_files $uri $uri/index.html) if not found, then forward the request to the internal proxy named@AnqiCMS, and@AnqiCMS will handle the requestproxy_passListening to AnQi CMS8001on the port.
After configuration is complete, please make sure to save and restart the Nginx or Apache service to take effect.
Step 3: Add a new site in the Anqin CMS backend
After completing the domain and reverse proxy configuration on the server side, you need to log in to the background management interface of the Anqi CMS main site and create and configure new logical sites through its built-in "Multi-site Management" feature.
Navigate to the "Multi-site Management" menu in the backend, then click the "Add New Site" button. In the pop-up configuration interface, you will fill in the details of the new site:
- Site name: Specify a recognizable name for the new site, which is only used for backend management.
- Site root directory: This option is crucial. You need to specify a name for the new site.A unique directory path on the server.This directory will be used to store the cache files and uploaded images for the new site