In today's internet environment, businesses and content operators often need to manage multiple independent websites, each possibly representing different brands, product lines, or content themes.AnQiCMS provides an efficient and flexible solution with its powerful multi-site management capabilities, allowing users to independently display the core content of each site under a unified backend management interface.
AnQiCMS's multi-site management capability overview
AnQiCMS was designed with the need for multi-site management from the beginning.It allows users to create and maintain multiple independent websites without interference through a core system.This means that whether it is the front-end display style of the website, the content published, or the data storage, they can all be independent of each other and not affect each other.This centralized management, content-independent model greatly simplifies the operator's workflow, improves efficiency, and is particularly suitable for users with multi-brand strategies or those who need segmented content operations.
The core of this 'independent display' lies in the clever binding and isolation of the front-end domain, back-end site configuration, and data storage by AnQiCMS.When a user accesses different domain names, AnQiCMS can identify which site the current request belongs to, and automatically load the corresponding site's configuration, template, and content, ensuring that each site can have its unique user experience and information presentation.
Key steps to achieve independent content display
To fully utilize the multi-site feature of AnQiCMS and ensure that each site's content can be truly independently displayed, we can follow several key steps:
An、Preparation and Deployment Strategy
The deployment of AnQiCMS is very flexible, whether it is through Docker, Baota panel, or command line, it can set up its running environment. An important prerequisite for achieving multi-site management is,An AnQiCMS instance can support the operation of multiple independent websites.This means we do not need to deploy a separate AnQiCMS program for each site.
On the server side, we need to configure reverse proxy to distinguish between different sites. For example, using web servers like Nginx or Apache, to differentiate between different domains (such asbrandA.comandbrandB.comThe request is unified forwarded to the port where AnQiCMS is running (default is 8001).The web server will route requests to AnQiCMS based on the visited domain name, and AnQiCMS will identify the corresponding site based on the domain name.
In particular, in the Baota panel or other environments, you will create a website configuration for each new site, and set up its reverse proxy rules, directing all requests from the domain to your AnQiCMS main program (for example,http://127.0.0.1:8001The external user accesses through different domain names will be responded to by the same AnQiCMS instance.
Secondly, add and configure a new site in the AnQiCMS backend.
Once the server environment is ready, we can create and configure new sites in the AnQiCMS backend. This is the core operation step to achieve independent content display.
Enter the management interface of AnQiCMS, find the "Multi-site Management" feature.Here, you can click "Add New Site" to create a brand new independent website.
- Site NameThis is an internal name you set for convenience to distinguish different sites in the background.
- Site Root DirectoryThis item is crucial.Although multiple sites share the same AnQiCMS program file, their cache, uploaded files, and other data need to be stored independently.
/app/dev_anqicms_com), Ensure the isolation of its data files. - Website address: Enter the full domain name of the new site, for example
http://dev.anqicms.comAnQiCMS will identify the current visited site based on this address. - Administrator account passwordCreate a set of independent backend management accounts and passwords for the new site.
- Database nameTo achieve complete independence of content, each site should have its own independent database. Typically, the database can be named following the format of the site domain (for example
dev_anqicms_comAvoid data confusion. - Database information reuseIf all your sites use the same database server and account system, you can choose to reuse the default database account information to simplify configuration.
- Select the template to useHere, you can select a completely independent frontend template for the new site. This means each site can have its unique appearance and user interface.
Through the above configuration, AnQiCMS can allocate independent storage space and database tables for each registered domain, thereby achieving strict isolation at the data level.
Three: The flexible application of content models and data isolation
AnQiCMS provides a highly flexible content model feature, allowing users to customize various content types according to business needs, such as articles, products, news, etc.In the multi-site scenario, the role of the content model is further amplified.
Each site can define and use a completely independent content model and fields based on its own characteristics.For example, an e-commerce site can have a 'product model' that includes fields such as price and inventory; while a news and information site can use a 'article model' that includes fields such as author and source.Since each site has an independent database, the data of these content models is also isolated from each other, ensuring the independence and purity of the content.
When you publish content in the background, select the corresponding site and content model. The published content will only be stored in the database of that site and displayed only on the front end of that site.
Ensure the template design for independent content display is intelligent:
The independent display of front-end content ultimately needs to be realized through a flexible template system.The template design of AnQiCMS adheres to a set of clear conventions, allowing each site to have a completely independent visual style and layout.
When creating a new site, you can specify a dedicated template package for it.This template package can include independent styles, scripts, and HTML structure.archiveList/categoryList/pageDetailetc.) are very intelligent:They will automatically fetch and display the current site's data by default when deployed in the frontend template of a specific site.For example, inbrandA.comin the template{% archiveList archives %}will only displaybrandA.comThe article list of the site.
This default behavior is the key to implementing 'independent content display'.You do not need to manually specify the site ID in each tag, the system will automatically identify and load the corresponding site content based on the current access domain.siteIdParameters allow you to explicitly specify which site's data to retrieve in the tag. However, for most cases of independent display, the default automatic recognition mechanism is already powerful and convenient.
By combining the independence of multiple layers such as content model, database, front-end template, and reverse proxy, AnQiCMS provides a comprehensive and powerful solution for multi-site operation, enabling each site to have its unique vitality.
Common Questions (FAQ)
- How is the data independently stored when all sites share an AnQiCMS instance?AnQiCMS assigns a new one to each newly created siteindependent database name for the new siteandA standalone site root directoryTo achieve data isolation.When adding a new site in the background, you need to specify a database name and file directory that do not duplicate with other sites.Thus, each site's content (articles, products, categories, etc.) is stored in its own database, while file resources (images, attachments) are stored in their own root directories, ensuring that the data does not interfere with each other.
2