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:
- The main application's
config.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. - In the template directory
config.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. - 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)
- **Ask: I created a new site on the AnQiCMS backend, I