How to configure the new site root directory for AnQiCMS multi-site deployment to achieve data isolation?

Calendar 👁️ 65

As an experienced CMS website operation person in the security industry, I am well aware of the core role of the content management system in current digital marketing.Especially when facing the needs of multi-site operations, the powerful functions and flexible configuration provided by AnQiCMS are undoubtedly our helpful assistant.Amongst them, how to properly configure the root directory of a new site to achieve data isolation is a key link to ensure the efficient and safe operation of multiple sites.

The value of AnQiCMS multi-site management and the necessity of data isolation

One of the core strengths of AnQiCMS is its excellent multi-site management capabilities.This allows us to efficiently manage multiple brands, different business lines, or multilingual content sites through a unified backend system.This centralized management model greatly reduces repetitive work, improves operational efficiency, and facilitates the integration and sharing of cross-site content.

However, while enjoying the convenience brought by multi-site management, we must also pay great attention to the issue of data isolation.Imagine if all the cache, uploaded files, logs, and other data of all sites were mixed together. Once a site has a problem, or needs to perform data migration or backup, management becomes extremely complex, and may even trigger a chain reaction, affecting the normal operation of other sites.Therefore, configuring an independent root directory for each logical site, just like allocating independent storage space for each tenant, is the cornerstone for ensuring data security, maintaining system stability, and simplifying operations and maintenance work in the future.It can effectively prevent data pollution, conflicts, and ensure high independence between sites.

Practical methods for configuring a new site root directory to achieve data isolation

To implement the data isolation in the multi-site deployment of AnQiCMS, the core lies in the precise configuration of the "site root directory" and the "database name".The design philosophy of AnQiCMS is that a single core application instance can serve multiple logical sites and identify and load the corresponding site configuration through visiting domain names.

First, when you need to add a new site under the same AnQiCMS instance, the first step is to log in to the AnQiCMS backend management interface of your main site.Find and click on the "Multi-site Management" feature in the left navigation menu, then select "Add New Site".

In the form of adding a new site, there are several key fields that we need to pay special attention to, as they are directly related to the implementation of data isolation:

The setting of the site root directory

The root directory of the site is a dedicated file storage space for each logical site.This directory is used to store the uploaded images, attachments, cache files, logs, and possibly independent template files for the site.To ensure complete data isolation and avoid naming conflicts, we must set a unique and standardized directory name for each new site.

For AnQiCMS instances deployed with Docker, the recommended naming convention for the site root directory is usually/app/The name is derived from the site domain name. For example, if your new site domain isdev.anqicms.comthen the suggested site root directory can be/app/dev_anqicms_com. Here,_replacing the domain name with.To comply with the naming conventions of the file system path. If you are deploying on a traditional Linux server through Baota panel or other methods, the root directory of the site can be set to/www/wwwroot/您的域名The form, for example/www/wwwroot/study.ykbh168.com.

The most important thing is to ensure that the directory name is unique throughout the AnQiCMS application's file system, and it is clearly indicated which site the directory is serving.This ensures that non-database data (such as uploaded resources, caches, etc.) for each site has its own independent storage path.

The independent configuration of the database name

The configuration of the "database name" complements the root directory of the site.Each new site should have an independent database, which is the most direct and thorough way to achieve site content data isolation.On the interface for adding a new site, you need to specify a unique database name for the new site, for exampledev_anqicms_com.

By using an independent database, we can ensure:

  • The core data of an article, product, category, and user on one site will not be confused with the data on another site.
  • When performing data backup, recovery, or migration, operations can be performed on specific sites without affecting other sites.
  • It is easier to locate the scope of the problem and reduce the risk during system updates or troubleshooting.

Under the Docker deployment scenario of AnQiCMS, it is usually possible to reuse the default database account information, as the AnQiCMS instance inside the Docker container usually has full database management permissions associated with the MySQL container.If you have special requirements or deploy the database externally, you need to fill in the corresponding database connection information according to the actual situation.

Reverse proxy settings for the front-end web server.

Although the AnQiCMS core application may only run on a specific internal port (such as 8001), visitors access your various sites through different domain names.This requires the front-end web server (such as Nginx or Apache) to perform its reverse proxy function.

You need to configure a reverse proxy rule for each new site domain on the Web server, redirecting all traffic to the address and port where the AnQiCMS core application is running (for examplehttps://en.anqicms.com). When the AnQiCMS application receives these requests, it will intelligently identify which logical site's request is being made based on the domain in the request, and will automatically load the independently configured root directory and database of that site in the background.This, user accesssiteA.comwill seesiteAand use its independent data, while accessingsiteB.comwill seesiteBand use its independent data, all of which are processed by the same AnQiCMS instance.

Summary: Practices for Efficient and Secure Operation

By following these steps, we can configure the independent site root directory and database for AnQiCMS multi-site deployment, thereby building an efficient and secure content management ecosystem.This configuration mode not only optimizes resource management and improves system stability, but also provides solid protection for the data of each site, ensuring their respective independence and integrity.As a website operator, adopting this practice is the key to long-term, healthy, and scalable operations.


Frequently Asked Questions (FAQ)

1. Why does each site need an independent 'site root directory'? What is the difference from database isolation?

The independent "site root directory" of each site is mainly used to store non-database data, such as: user uploaded images, attachment files, system generated cache files, log files, and possibly existing independent template files.Its role is to ensure that these file-level data will not be confused or conflicted, thus achieving file-level data isolation.And database isolation refers to assigning an independent database to each site for storing all structured data of the site, such as article content, category information, user data, and so on.Both are different dimensions of data isolation, which together constitute a complete data security guarantee for multi-site deployment.

2. Does the multi-site deployment of AnQiCMS mean that a set of AnQiCMS program needs to be installed for each site?

Not required. The multi-site feature design of AnQiCMS is intended to manage multiple independent logical sites through a single AnQiCMS application instance.This means you only need to install a set of AnQiCMS programs, and then add and configure new logical sites through the "multi-site management" feature in its background.Each logical site will have its own domain name, its own site root directory, and its own database, but they will share the same AnQiCMS core application.This architecture greatly simplifies the deployment and maintenance work.

3. Do I need an independent site root directory if all my sites use the same template?

Even if all sites use the same template, it is strongly recommended to configure an independent site root directory for each site.Although template files may be shared, each site still generates its own cache files, uploaded images and attachments (unless you have configured a shared bucket or CDN), as well as independent logs, etc.The independent site root directory can effectively isolate these non-template file data, prevent chaos, and facilitate the operation of an independent site needing to update templates or maintain data in the future without affecting other sites.

Related articles

How to deploy multiple independent AnQiCMS sites on the same physical server?

In the rapidly changing digital age, businesses and content operators often face the challenge of managing multiple websites.AnQiCMS (AnQiCMS) is an efficient content management system developed based on the Go language, and its multi-site management function is exactly designed to solve this pain point.As an experienced website operator proficient in AnQi CMS, I am well aware of the readers' desire for efficient and convenient solutions.Today, I will elaborate on how to deploy multiple independent security CMS sites on the same physical server, helping you optimize resources and simplify management.## Start Your Multi-Site Journey

2025-11-06

How to use the stop script `stop.sh` written by author fesion in AnQiCMS?

AnQiCMS (AnQiCMS) is a high-efficiency and feature-rich Go language content management system, its stable operation cannot do without refined deployment and management.As a website operator, we not only need to pay attention to content creation and optimization, but also ensure the smooth operation of the system backend.In this case, the stop script `stop.sh` plays a crucial role, which can help us safely and effectively manage the lifecycle of AnQiCMS services.### Core function to stop the script `stop.sh` `stop

2025-11-06

What is the main function of the startup script `start.sh` written by "author fesion" in the AnQiCMS task schedule?

In the daily operation of AnQiCMS (AnQiCMS), the stable operation of the system is the key to ensuring user experience and content distribution efficiency.To ensure that the AnQiCMS service can provide content continuously and uninterruptedly, even if it encounters unexpected interruptions and can recover quickly, a meticulously designed startup script plays a crucial role in the scheduled tasks.Among them, the `start.sh` script written by "author fesion" was born for this purpose, and it constitutes the core of the self-protection mechanism of AnQiCMS service.### `start

2025-11-06

How to configure Nginx pseudo-static rules for AnQiCMS on the Baota panel?

As an experienced CMS website operation personnel of AnQi, I know that efficient content management and excellent search engine optimization (SEO) play a decisive role in the success of the website.Static page, it is an indispensable part of it, not only does it make the website URL structure more concise and beautiful, but more importantly, it can significantly improve the search engine's ability to capture and understand the content of the website.AnQiCMS was designed with this in mind from the beginning, it has built-in powerful pseudo-static management functions, but to make full use of it, the configuration of Nginx pseudo-static rules on the server side is crucial

2025-11-06

How to configure reverse proxy through 1Panel when installing AnQiCMS with Docker?

AnQiCMS, as an enterprise-level content management system developed based on the Go language, is an ideal choice for small and medium-sized enterprises and content operation teams with its efficient, secure, and user-friendly features.Combining 1Panel, a convenient server management panel, deploying AnQiCMS via Docker containers can greatly simplify the installation and maintenance process.To allow AnQiCMS to access through a custom domain and hide its internal running port, configuring reverse proxy is an essential step before the website goes into operation.

2025-11-06

Install AnQi via Docker on aaPanel

Anq CMS is an enterprise-level content management system based on the Go language, designed to provide an efficient, customizable and easy-to-expand content management solution.As a website operator familiar with content creation and optimization, I understand how important a stable and efficient system is.This article will give a detailed introduction on how to use the Docker function of the aaPanel to quickly deploy the Aq CMS, helping you build and start your website efficiently.

2025-11-06

What is the real meaning of checking if the PID exists in the AnQiCMS startup script?

As an experienced security CMS website operations personnel, I know that the logic behind each system component is crucial for the stable operation and efficient management of the website.The startup script serves as the starting point of the application lifecycle, its design often embodies considerations for system robustness and operational convenience.Now, let's delve into the true significance of the "check if PID exists" section in the Anqi CMS startup script.

2025-11-06

How to determine if the AnQiCMS process is running on the server?

As an expert who deeply understands the operation of AnQiCMS, I am well aware of the importance of stable system operation for website business.Determine whether the AnQiCMS process is running normally on the server, which is a basic and crucial task in daily operations.It is crucial to accurately grasp the process status, whether it is to investigate website access failures or to confirm whether the scheduled tasks are effective.

2025-11-06