How to configure multiple sites in AnQiCMS to achieve independent display of content under different domain names?

Calendar 👁️ 83

AnQiCMS provides powerful multi-site management features, allowing you to easily operate multiple independent websites within the same system, each with its own domain and content.This is undoubtedly a very convenient and efficient solution for operators who have multiple brands, sub-sites, or need to provide differentiated content for different audience groups.Through a unified backend management entry, you do not need to deploy a separate system for each site, which greatly simplifies the operation and maintenance work, while also ensuring the complete independence of the front-end content display.

Next, we will discuss in detail how to configure multiple sites in AnQiCMS to ensure that the content under each domain can be displayed independently without interference.

Understand the core advantages of AnQiCMS multi-site management

Before delving into the configuration, let's first clarify the core value that AnQiCMS multi-site management brings to you.It is not just simple to manage multiple websites, but more importantly, it has realized the isolation of content and data.This means:

  • Content independent:Each site has independent articles, products, pages, categories, and tag data. You can publish exclusive content based on the positioning of different sites.
  • Domain independent:Each site can be bound to different domain names to achieve differentiation in brand or business.
  • Management centralized:Although the content is independent, the management of all sites can be carried out on the same AnQiCMS backend, making operations convenient and more efficient.
  • Resource sharing and customization:Although the content is independent, the underlying system resources (such as servers, database connection pools) can be shared, and each site can flexibly choose or customize its own template to achieve personalized display.

In short, AnQiCMS's multi-site feature aims to provide a solution that can be both centrally managed and highly independent in content.

Prepare your server environment

Before adding a new site in AnQiCMS, you need to make sure the server environment is ready for the new domain name.The key step is to configure the reverse proxy to correctly forward access requests to the running AnQiCMS application.

No matter whether you deploy AnQiCMS directly in the Linux environment or through Docker containers (such as using Baota panel, 1Panel, aaPanel, etc.), the core idea is the same:

  1. Resolve new domain:First, resolve the domain name you plan to use for the new site to your server IP address.

  2. Configure reverse proxy:

    • For Nginx or Apache users:You need to add a reverse proxy rule for the new domain in the Web server configuration file. This rule will listen to the HTTP/HTTPS requests of the new domain and forward them to the port that the AnQiCMS application is listening on (the default port for AnQiCMS is usually8001)

      • For example, with Nginx, you willnginx.confadd a configuration section similar to the following in a standalone site configuration file, make sureproxy_passthe internal address and port point to AnQiCMS:
      server {
          listen 80;
          server_name new.anqicms.com; # 您的新域名
          root /www/wwwroot/new.anqicms.com/public; # 建议为新站点设置独立的公共目录
      
          location @AnqiCMS {
              proxy_pass https://en.anqicms.com; # AnQiCMS 应用监听的端口
              proxy_set_header Host $host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          }
          error_page 404 =200 @AnqiCMS;
          location / {
             try_files $uri $uri/index.html @AnqiCMS;
          }
      }
      

      Please note,rootThe directory in the actual multi-site configuration usually points to the root directory of the new site for storing static resourcespublicFolder, this is a different concept from the "Site Root Directory" set in the AnQiCMS backend, which is the logical directory used by AnQiCMS to store its own data (such as cache, uploaded files).

    • For Baota panel, 1Panel, or aaPanel users:These panels typically provide a graphical interface to simplify the configuration of reverse proxies. You can create a new reverse proxy site and bind a new domain to the127.0.0.1:8001(If your AnQiCMS is running on a different port, please modify accordingly).These panels will also handle the underlying configuration and pseudo-static rules of Nginx/Apache.

After completing the reverse proxy configuration, you need to restart your web server (Nginx or Apache) for the changes to take effect.At this time, accessing the new domain name through the browser should display the AnQiCMS installation wizard or the interface of the default site, indicating that the request has been successfully forwarded to AnQiCMS.

Add a new site in AnQiCMS backend

After the server environment is ready, proceed to create a new site in the AnQiCMS backend:

  1. Log in to the default site backend:Log in to the AnQiCMS backend management system using your main domain or any existing site domain (for exampleyourdomain.com/system)
  2. Enter multi-site management:In the left navigation menu, find and click the 'Multi-site Management' feature. Here will be listed all configured sites.
  3. Add a new site:Click the 'Add new site' button on the page. You will see a form that requires you to fill in the details of the new site:
    • Site Name:Specify an easily recognizable name for your new site, such as "Product Display Site" or "Company Sub-brand A". This helps you quickly distinguish different sites in the background.
    • Site root directory:This is a very critical setting, used to independently store cache, uploaded files, logs, and other data for a new site. To ensure complete independence of content and data,You must set a unique site root directory for each site.It is recommended to start the path with/app/The beginning (if AnQiCMS is deployed in Docker, this is its internal path), and combined with the domain name, for example/app/new_anqicms_com.
    • Website address:Enter the complete access address of the new site, that is, the new domain name you previously configured for reverse proxy, for examplehttp://new.anqicms.com.
    • Admin account password:Set up a separate admin account and password for this new site. This means that even if the content and database of the new site are independent, you can assign a separate administrator to manage it.
    • Database name:In order to achieve data independence, you need to specify a new site fora new, unused database name. Similar to the site root directory, it is recommended to name it with a domain name or site name, for examplenew_anqicms_db.
    • Database information reuse: Check the option 'Reuse default database account information' is usually recommended, especially when your AnQiCMS instance (especially Docker deployment) already has full management permissions for the database, and there is no need to re-enter the database connection credentials.If you wish to use a different database server or account for the new site, you can uncheck and fill in manually.
    • Select the template to use:Select a template suitable for the new site from the drop-down list. AnQiCMS supports flexible template switching, allowing you to choose different themes for each site, even customizing exclusive templates.
  4. Confirm creation:Please carefully check all the information filled in, especially the uniqueness of the site root directory and the database name, then click the "OK" button to complete the creation of the new site.

Access and manage your new site

After the site is created successfully, you can now access the front-end page through the new domain.

  • Access the front-end:Enter the new domain you have bound in the browser (for examplehttp://new.anqicms.com), you will see the front-end content of the new site. Since the data is independent, it will display a brand new, unfilled site interface (or the default content of the template you choose).
  • Access the backend:Access the backend address of the new site, usually您的新域名/system/(For example)http://new.anqicms.com/system/) Use the administrator account and password you set when creating the site to log in.

After logging into the backend of the new site, you will find that its content management module (documents, categories, pages, etc.) is completely blank, waiting for you to fill in exclusive content.This means that all content operations for the new site will be carried out in its independent backend environment, completely isolated from the data of the main site, achieving truly independent content display.

Content is independent of the template application

Through the above configuration, the new site has been completely separated from the default site at the data level.This means that any articles, products, pages, or categories you post in the new site's backend will only be displayed under the new site's domain.

In terms of template design, AnQiCMS supports a directory containing one for each set of templatesconfig.jsonFiles are used to describe template information, and you can choose different templates for each site.This means you can create a unique user interface and experience for each site, further strengthening the independence of its content and brand recognition.

Although this article mainly focuses on the independent display of content, it is worth mentioning that the template tags of AnQiCMS (such asarchiveList/categoryList) also providesiteIdThe parameter. In some advanced scenarios, if you need to display specific content on a siteother sitesyou can specifysiteIdParameters to implement cross-site data calls, but by default, each site's tag call will act on its own site's data.

The multi-site management function of AnQiCMS allows you to enjoy the convenience of centralized management while also easily dealing with the complex content operation needs of multiple brands and business lines. It ensures that the content under each domain name is presented to the end users in an independent and customized manner.


Frequently Asked Questions (FAQ)

1. What is the difference between AnQiCMS's multi-site feature and installing multiple independent AnQiCMS instances on the same server?The multi-site feature of AnQiCMS allows you toin the same AnQiCMS application instanceManage multiple websites with independent domains and content (including databases and storage directories).This means that only one AnQiCMS application is running, sharing some of the underlying resources (such as the Go application process, some configurations).And installing multiple independent AnQiCMS instances means deploying multiple completely independent AnQiCMS applications on the server, each with its own process, port, database, and file system.The multi-site function is logically isolated at the software level, while multiple instances are physically isolated.The multi-site function saves more server resources and a unified management entry, suitable for scenarios where content relevance is not strong but managers wish to manage centrally.

2. Can I share some content between different sites?By default, AnQiCMS's multi-site design is to achieve independent content. However, for certain special requirements, AnQiCMS's template tags (such asarchiveList/categoryList/pageListProvidedsiteIdSpecify through the tag.siteIdYou can try to call it on the current site.other sitesThe specific content. But this requires your template developer to customize according to business logic to ensure the accuracy and security of the data display, and this sharing is usually one-way (from a source site to a target site).

3. Will changing the template of one site affect the others?I can't. AnQiCMS allows each site to independently select and use different templates.When you create a new site, you specify the template it will use.You can change or modify the template of the current site at any time in the background management of the new site, and these operations will only affect the appearance and layout of the current site, and will not affect any other configured sites.This design provides great flexibility, allowing each site to have a unique user experience.

Related articles

How to count the number of times a specific keyword appears in the title or description of an article?

As users of Anqi CMS, we often need to manage and analyze website content in a refined manner, one common requirement being to count the frequency of specific keywords in article titles or descriptions.This not only helps us understand the effectiveness of content marketing, optimize SEO strategies, but also better grasp user concerns.AnQi CMS with its flexible template engine and rich built-in filters makes this operation feasible at the front-end template level.

2025-11-09

How to automatically convert line breaks in user input plain text content to the HTML `<br/>` tag?

In daily website content operations, we often need to enter some multi-line text content in the Anqi CMS backend, such as the introduction of articles, the characteristics of products, or detailed descriptions in custom fields.This content is usually entered in plain text format, however, when we expect them to be displayed on the front-end web page with the original paragraph and line break effects, we find that they are often cramped into a line, losing their original formatting.This is not a problem with the AnQi CMS system itself, but a characteristic of the HTML web page rendering mechanism.in HTML

2025-11-09

How to prevent XSS attacks and correctly escape HTML special characters when outputting article content in a template?

Managing and displaying content in AnQiCMS is the core task of website operation, but it is also crucial to ensure that these contents are presented safely and securely to users.Among them, cross-site scripting (XSS) attacks are a risk that should not be ignored, which may allow malicious code to be executed in the user's browser accessing your website, thereby triggering a series of security issues, such as stealing user data, tampering with page content, and even hijacking user sessions.

2025-11-09

Extract the article summary by word count instead of character count, which filter should be used in the template?

In website content operation, the way articles are presented often directly affects readers' click intentions and reading experience.A clear and concise summary that helps readers quickly understand the main theme of the article.Especially in scenarios such as list pages and recommendation areas, we usually hope that the abstract can be intelligently extracted, controlling the length while maintaining readability.When it comes to generating abstracts based on the content of an article, the length of the excerpt is a core consideration.There are two common ways to truncate: by character count and by word count.Cutting by character count is accurate, but it often encounters the situation where words are abruptly cut off

2025-11-09

How to customize a content model for specific business needs and elegantly display its content on the front end?

In website content operation, we often encounter situations where we need to display diverse information.Traditional CMS may only provide fixed types such as 'articles' or 'products'. When business needs become more complex, such as displaying real estate information, job openings, event schedules, etc., these fixed types often seem inadequate.At this time, the flexible content model function of AnQiCMS is particularly important, it allows us to tailor the data structure to meet specific business needs and present the content in the way we want on the front end.Why do we need a custom content model?Imagine

2025-11-09

How does AnQiCMS support the switching and correct display of multilingual content?

AnQiCMS demonstrates excellent support capabilities in global content promotion. It provides a flexible mechanism to help us switch between multilingual content and display it correctly, thereby effectively reaching user groups from different language backgrounds. ### Core Mechanism: Making Content Speak Multiple Languages AnQiCMS's multilingual support is not just about translating the website interface, but also deeply involves the organization and presentation strategies of content.In its design philosophy, the implementation of multilingualism is mainly reflected in two levels: one is the localization processing of static text at the system level and template level.

2025-11-09

How to optimize URL structure through pseudo-static rules to improve the display and crawling of content by search engines?

In website operation, a clear, search engine friendly URL (Uniform Resource Locator) is crucial for the display and crawling of content.AnQiCMS (AnQiCMS) provides powerful pseudo-static rule management functions, allowing us to flexibly optimize the URL structure of the website, thereby effectively enhancing the performance of search engines.### Why is URL structure important?First, let's understand why the structure of URL is so crucial for the SEO (Search Engine Optimization) of a website. 1.

2025-11-09

How to set up 301 redirect to avoid the display effect of page when the content URL changes?

## No worries about URL changes: Anqi CMS sets up 301 redirects easily, avoiding any impact on the page display effect URL changes are common in the operation of a website.It is necessary to adjust the website URL due to the need for optimizing content structure, integrating old information, and even changing domain names.However, if these changes are not handled properly, it is like sending a 'missing person' notice to an old address, visitors and search engines will encounter a 404 error page at the old link, which will seriously harm the user experience

2025-11-09