In today's internet environment, businesses and content operators often need to manage multiple independent websites, each of which may represent different brands, product lines, or content themes.AnQiCMS (AnQiCMS) provides a powerful multi-site management capability, offering users an efficient and flexible solution that makes it possible to independently display the core content of each site under a unified backend management interface.
Overview of AnQiCMS multi-site management capabilities
AnQiCMS was initially designed with the need for multi-site management in mind.It allows users to create and maintain multiple independent websites 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, independent content 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 AnQiCMS's clever binding and isolation of the front-end domain, back-end site configuration, and data storage.When a user visits different domain names, AnQiCMS can identify which site the current request belongs to and automatically load the corresponding site's configuration, template, and content, thereby ensuring that each site can have its unique user experience and information presentation.
The key steps to achieve independent display of content
Make full use of the multi-site feature of AnQiCMS and ensure that the content of each site can be truly independently displayed, we can follow the following key steps:
First, environment preparation and deployment strategy
The deployment of AnQiCMS is very flexible, whether through Docker, Baota panel, or command line, it can build its running environment. An important prerequisite for implementing multi-site management is,An AnQiCMS instance can support the operation of multiple independent websitesThis means we do not need to deploy a separate AnQiCMS program for each site.
At the server level, we need to configure reverse proxy to differentiate between different sites. For example, using web servers like Nginx or Apache, to map different domain names (such asbrandA.comandbrandB.comThe request is unified forwarded to the port where the AnQiCMS program is running (default is 8001).The web server routes requests to AnQiCMS based on the visited domain name, and AnQiCMS identifies 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 examplehttp://127.0.0.1:8001)。This way, external users accessing through different domain names will be responded to by the same AnQiCMS instance.
Second, add and configure a new site in the AnQiCMS backend.
Once the server environment is ready, we can create and configure a new site in the AnQiCMS backend. This is a core operation step to achieve independent content display.
Enter the AnQiCMS backend management interface and find the "Multi-site Management" feature.Here, you can click "Add a new site" to create a brand new standalone website.In the pop-up configuration interface, there are some key information that needs to be filled in carefully:
- Site nameThis is the 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.Therefore, it is recommended to set up a separate, domain-named root directory for each site (for example
/app/dev_anqicms_comEnsure the isolation of the data file. - website address: Enter the complete domain name of the new site, for example
http://dev.anqicms.com. AnQiCMS will identify the current visited site based on this address. - Administrator account password: Create 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 format of the site domain name can be used to name the database (such as
dev_anqicms_com),avoid data confusion. - Duplicate database informationIf 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 choose a completely independent front-end template for the new site. This means that each site can have its unique appearance and user interface.
By the above configuration, AnQiCMS can allocate independent storage space and database tables for each registered domain, thus achieving strict isolation at the data level.
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.Under multi-site scenarios, the role of the content model is further amplified.
Each site can define and use a completely independent content model and its fields according to its own characteristics.For example, an e-commerce site can have a "product model" that includes price, inventory, and other fields;And a news information site can use the 'article model', including fields such as author, source, and the like.Due to each site having 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, and the content you publish will only be stored in the database of that site and displayed only on the front end of that site.
Four, ensure the template design displays the content independently
The independent display of front-end content ultimately needs to be realized through a flexible template system.AnQiCMS's template design follows a clear convention, 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.AnQiCMS template tags (such asarchiveList/categoryList/pageDetailVery smart:When deployed in the front-end template of a specific site, it will automatically retrieve and display the data of the current site by default.For example, inbrandA.comin the template.{% archiveList archives %}will only display.brandA.comThe list of articles on the site.
This is the key to achieving 'independent content display'.You do not need to manually specify the site ID in each tag, the system will automatically identify and load the content of the corresponding site based on the current access domain.Of course, if you indeed have a need to display cross-site content (such as displaying selected content from child sites on the main site), AnQiCMS also providessiteIdParameters allow you to explicitly specify which site to retrieve data from in the tag. However, for most cases of independent display, the default automatic recognition mechanism is already strong and convenient.
By combining the independence of content models, databases, front-end templates, and reverse proxies at multiple levels, AnQiCMS provides a comprehensive and powerful solution for multi-site operations, allowing each site to have its unique vitality.
Frequently Asked Questions (FAQ)
- How do the data of all sites that share an AnQiCMS instance achieve independent storage?AnQiCMS assigns one to each newly created siteindependent database nameandindependent site root directoryTo implement 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.This way, the content of each site (articles, products, categories, etc.) is stored in its own database, and file resources (images, attachments) are stored in its own root directory, ensuring that the data does not interfere with each other.
2