How to distinguish the file path of `config.` for different sites in multi-site configuration?

Calendar 👁️ 71

AnQiCMS (AnQiCMS) is an efficient and flexible content management system, and its multi-site management function is undoubtedly a highlight favored by many operators. However, when it comes to multi-site configuration, some seemingly basic details, such as the different sites'config.jsonHow to distinguish file paths, which often causes confusion for users.Today, let's delve deeply into this topic and help everyone clearly understand the configuration logic of AnQiCMS under the multi-site architecture.

Understanding the core function of the AnQiCMS configuration file

In the world of AnQiCMS,config.jsonIt is a very critical file.It is usually located in the root directory of AnQiCMS installation, carrying the most basic and core configuration information of the entire application.This includes the system running ports, database connection parameters, debug mode settings, and some global service configurations.It can be said that it is the 'heart' of AnQiCMS for starting and normal operation.

According to our documentation, when you need to run on the same server,Multiple independent AnQiCMS application instancesInstead of using its built-in multisite functionality to manage multiple websites, each application instance requires its own independentconfig.jsonFile. At this point, you will assign a different port to each instance (for example, the default 8001, another instance may use 8002, 8003, etc.), and write this port information clearly in the root directory of each instance.config.jsonIn this case, distinguishing differentconfig.jsonThe path is very simple: they are located at the root of each AnQiCMS installation directory.

Under AnQiCMS multi-site configurationconfig.jsonPath resolution

The strength of AnQiCMS lies in its built-in 'Multi-site Management' feature. This feature allows you to managean instance of the AnQiCMS applicationCreate and manage multiple independent websites easily through the background management interface. This is a different concept from running multiple independent AnQiCMS instances mentioned above.

Then, in thisAn application manages multiple websitesUnder the model, how should the file paths of different sites be distinguished?config.jsonHow should the file path be distinguished?

The answer is:For sub-sites created through the AnQiCMS backend multi-site management feature, they usually do not have their own independent configuration files similar to the main applicationconfig.json.

This may sound surprising, but it is an embodiment of the multi-site design concept of AnQiCMS.When you add a new site in the AnQiCMS backend, the system will prompt you to fill in a series of information, such as the site name, website address, administrator account password, and a very important 'site root directory' path.config.jsonIt is used to independently store the new site.Cache data, upload files, logs, and other runtime-generated data..At the same time, each new site will have an independent database name (or reuse the main site's database account information), and the specific configuration details and business data will be stored in the database connected to the main application and managed by the core program of AnQiCMS.

Therefore, under the multi-site architecture of AnQiCMS, we distinguishconfig.jsonThe idea of file path will be clearer:

  1. The main application'sconfig.jsonFile:There is only one, located in the root directory where you initially installed AnQiCMS.It controls the global operating parameters of the entire AnQiCMS instance (including all managed child sites), such as the main port, database connection, etc.
  2. In the template directoryconfig.jsonFile:These files are located inside each template folder, for example/template/{template_name}/config.jsonThey are not the configuration of the site, but are used to describethe information of the template itself(such as template name, version, author, type, etc.), unrelated to the site-level runtime configuration.
  3. Sub-site configuration: The specific configuration of the child site (such as domain name, content model, SEO settings, language package, etc.) is not independent of the main site.config.jsonFiles are defined not by a configuration file, but through the backend management interface of the main AnQiCMS instance, and are finally stored in the main application's database.Their 'site root directory' mainly serves the purpose of file storage isolation.

In short, if you create multiple websites through AnQiCMS's "Multi-site Management" feature, you only need to focus on one coreconfig.jsonThe file is the one in the installation directory of your main AnQiCMS application. The personalized settings of other sites will be managed through the background interface.

Summary

AnQiCMS through a simple and efficient architecture, has realized the convenience of multi-site management.Understanding the management logic of its configuration file can help us better carry out system deployment and daily maintenance.config.jsonResponsible for global application configuration, templateconfig.jsonResponsible for template metadata, while the configuration of child sites under the multi-site function is mainly scheduled by the main program through the database.

Frequently Asked Questions (FAQ)

  1. **Ask: I created a new site on the AnQiCMS backend, I

Related articles

How to view the storage path of AnQiCMS log files to troubleshoot program errors?

As an experienced website operations expert, I know that log files play a crucial role behind the stable operation of the system.When your AnQiCMS website encounters a program error, the log file is like a clue in a detective's hands, which can help us trace the cause and specific details of the problem.AnQiCMS is an enterprise-level content management system developed based on the Go language, with a simple and efficient logging mechanism. Understanding the storage path and viewing method of the log files is the first step in troubleshooting program errors and ensuring the healthy operation of the website.

2025-11-06

When deploying AnQiCMS with Baota panel, which folder should the Nginx running directory be configured to?

As an experienced website operation expert, I am happy to give you a detailed explanation of the correct configuration method of the Nginx running directory when deploying AnQiCMS with Baota panel, and to analyze the principles behind it in depth to ensure that you not only know the what, but also the why. --- ### When deploying AnQiCMS with Baota panel, which directory should the Nginx running directory be configured to?Deep analysis and practice Deploying AnQiCMS and such Go language applications using Baota panel

2025-11-06

How to view the root directory path of the AnQiCMS container in Docker environment?

When deploying AnQiCMS with Docker, you may sometimes encounter situations where you need to explore its internal file structure, such as locating the actual root directory path of the website.This is very important for troubleshooting file access issues, performing manual file modifications, or deeply understanding the operation mechanism of AnQiCMS within the container.As a website operations expert, I fully understand the value of this exploration. Next, let's unveil the 'mysterious veil' of the root directory of the AnQiCMS container website.

2025-11-06

What is the actual file path represented by variables like `{filename}` or `{catname}` in static rules?

## Unveiling the 'mysterious code' in AnQi CMS static rules: the truth about `{filename}` and `{catname}` As an experienced website operations expert, I am well aware that a friendly and efficient URL structure is crucial for a website's search engine optimization (SEO) and user experience.AnQiCMS (AnQiCMS) provides strong support in this aspect, especially its flexible static rule management function.However, when configuring these rules

2025-11-06

Where is the actual storage path of these image resources after I upload them to the background?

As an experienced website operation expert, I know the importance of image resource management for website performance, SEO, and even user experience.AnQiCMS (AnQiCMS) has made many meticulous designs in this aspect, allowing content operators to manage these valuable visual assets more efficiently.Today, let's delve deeply into a question that concerns everyone: 'Where are the actual storage paths of the image resources after I upload them to the backend?'}]

2025-11-06

How to set up the background to view or modify the specific URL address of the website logo image?

As an experienced website operations expert, I am well aware of the importance of the website logo to the brand image.It is not only the 'front door' of the website, but also a key element for users to identify your brand.In a powerful content management system like AnQiCMS, managing the website logo image address is a fundamental and frequent operation.Today, let's delve into how to easily view or modify the specific URL address of the website logo image through backend settings.

2025-11-06

Which file path variables are available when customizing the static rules?

Hello! As an old soldier who has been deeply involved in website operations for many years, I know that a flexible and powerful static mechanism is crucial for the website's search engine optimization (SEO) and user experience.AnQiCMS (AnQi CMS) performs very well in this aspect, it not only provides a variety of out-of-the-box static mode, but also allows for deep customization of URL structure, which undoubtedly provides great convenience for refined operation.Today, let's delve into the discussion of which key file path variables we can flexibly use when customizing pseudo-static rules in Anqi CMS

2025-11-06

How to specify the file path of the public code snippet included when using the `include` tag in the template?

As an experienced website operations expert, I know the importance of an efficient content management system (CMS) for website operations.AnQiCMS (AnQiCMS) provides a solid foundation for us to build various websites with its flexibility and powerful template features.Today, let's talk about one of the very practical features that can greatly improve template development efficiency - the `include` tag, especially how the file path is specified when referencing common code snippets, which is often a place where beginners and even experienced developers may feel confused.Why choose to use

2025-11-06