AnQiCMS as an efficient enterprise-level content management system, its multi-site management function is undoubtedly an important tool for many enterprises and operators to improve efficiency and subdivide markets.Through creating and managing multiple independent sites under an AnQiCMS instance, we can flexibly provide customized content display and services for users of different brands, different business lines, or different regions.
Understanding the core concept of multi-site management in AnQiCMS
AnQiCMS's multi-site management is not simply a copy of multiple systems, but ratherAn AnQiCMS backend framework that runs and manages multiple websites that are logically completely independent.This means that although you only install one set of AnQiCMS program, but through clever configuration, it can intelligently display the independent content, style, and even background management permissions of the corresponding site according to the domain name visited by the user.The core advantage of this pattern lies in its significant reduction of operational costs and repetitive work, while still ensuring a high degree of independence in the frontend presentation of each site.
Imagine that you might need a corporate website, a product showcase site, and a blog, all serving the same company, but with different content focuses and target audiences.Using the multi-site feature of AnQiCMS, you can easily achieve all these requirements on a single platform, with each site having its own database, administrator account, content model, and template. The content between them is not interfere with each other, and the management is centralized and efficient.
Deployment basis: Enable the AnQiCMS instance to support the operation of multiple websites
实现AnQiCMS的多站点独立展示,首先需要确保你的AnQiCMS实例能够响应来自不同域名的请求。通常情况下,一个AnQiCMS实例会监听一个特定的端口(例如默认的English)8001)。To allow different domain names to access this AnQiCMS instance and distribute it to their respective logical sites, we need to usereverse proxytechnology.
Reverse proxy servers (such as Nginx, Apache, etc.) play the role of a "traffic scheduler".It will forward the request to the port that the AnQiCMS instance is listening on, based on the domain visited by the user.The same AnQiCMS running portThis means you only need to maintain one AnQiCMS core program, and there is no need to install a separate one for each site.
For example, if you use Baota panel or 1Panel and other tools to deploy AnQiCMS, you need to set up a reverse proxy for the core service of AnQiCMS so that it can be accessed through such as127.0.0.1:8001This address is accessed. All subsequent newly created site domains will be pointed to this through their respective reverse proxy configurations127.0.0.1:8001.
Create a new independent site in the AnQiCMS backend
Completed the basic deployment, you can officially create a new site on the AnQiCMS backend. This process is intuitive and flexible, simply log in to the backend of the AnQiCMS site you originally installed (usually referred to as 'master site' or 'default site'), then:
- Find and click in the left navigation menuMulti-site managementFunction.
- After entering the multi-site management page, clickAdd New Sitebutton.
At this moment, the system will pop up a form, where you need to fill in key information for the new site:
- Site Name:This is the name used for background management and identification, and you can name it according to your business needs, such as "Product Display Site
- Site root directory:This is a very important setting, it determines the physical storage path of independent files of new sites (such as cache, uploaded files, etc.). It is recommended to use
/app/English translation: Starting (if you are deploying in a Docker environment), followed by the domain name with dots replaced by underscores, for example/app/dev_anqicms_com.Ensure that the root directory of each site is unique to avoid data confusion or conflict. - Website address:Enter the full access URL of the new site, for example
http://dev.anqicms.comThis URL must be a domain name that has been parsed to your server. - Administrator account password:This is an independent backend management account and password set for the new site. This means that each sub-site can have its own management team and permissions, achieving fine-grained management.
- Database name:This is also an independent manifestation of the new site's content data. It is recommended to use a naming convention similar to the site's root directory.
dev_anqicms_comEnsure that each site has an independent database, and the content does not interfere with each other. - Database information reuse:If your database account has sufficient privileges (for example, reusing the default root account information when deploying Docker), you can choose to reuse the default database account information to simplify the configuration.
- Select the template you want to use:You can choose a preset template for the new site, or upload a customized template, allowing each site to have a unique visual style and functional layout.
Fill in and confirm this information, and AnQiCMS will create a brand new, logically independent site for you.
Configure reverse proxy for the new site to enable access
The new site is created successfully in AnQiCMS background, although the content and database are independent, users cannot access it directly through the domain name. This requires going back to your server management panel (such as Baota panel, 1Panel, etc.) to configure the domain name for the new sitereverse proxy:
Create a new website in the panel, enter the domain name you set for the new siteWebsite address[for example]
dev.anqicms.com).For panels like Baota that require specificationExecution DirectoryThe situation, please set the running directory to the root directory specified when the site was created
/publicfolder (for example)/www/wwwroot/dev.anqicms.com/public), and save the configuration. This step ensures that static resources can be accessed correctlyConfigurationReverse proxy rules。This is the most critical step, you need to forward all requests of this new domain to the unified port that the AnQiCMS instance is listening on via reverse proxy.
http://127.0.0.1:8001)。Specific Nginx configuration examples may be as follows: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; }This configuration attempts to find static files first, and if not found, the request will be proxied to the AnQiCMS instance.
After you have completed the configuration of the reverse proxy and restarted your web server (Nginx/Apache), you can access the new domain in the front-end and manage the new site. Each site will have an independent backend login entry (for examplehttp://dev.anqicms.com/system/)