How to configure a separate domain and database information for a new site in AnQiCMS multi-site management?

Calendar 👁️ 79

AnQiCMS with its efficient and flexible multi-site management features provides great convenience to users, especially in scenarios where it is necessary to set up independent sites for different brands, products, or services.When you want to configure a separate domain and database information for a new site, AnQiCMS provides a clear and practical management process.This not only helps to isolate and secure the data, but also allows each site to have more independent operation and optimization space.

Understanding the value of independent configuration for multi-site management

Before discussing specific operations, it is crucial to understand why it is important to configure independent domain names and database information for each new site.A unique domain name allows each site to have a distinct brand image, convenient for users to remember and access, and also有利于 search engine optimization (SEO), enabling each site to obtain independent weight and ranking.An independent database means that the data of each site (such as content, users, settings, etc.) are isolated from each other and do not interfere.This isolation mechanism greatly enhances data security, avoids potential cross-contamination, and also facilitates independent backup, migration, or recovery of a single site, improving the robustness and maintainability of the overall system.

Core premise: A running AnQiCMS main site

To start configuring a new standalone site, you need to have a running AnQiCMS main site on your server first.Whether it is through Docker container deployment (such as using the Docker management function of 1Panel or Baota panel), or manual deployment directly in the Linux environment, ensuring that the main site can be accessed and managed normally is the first step.If you have not completed the deployment of the main site, you can refer to the official installation tutorial of AnQiCMS and choose the deployment method suitable for your server environment first.

Prepare an independent domain and reverse proxy for the new site

Configure the independent domain name for the new site, first you need to perform domain resolution, pointing the A record of the new domain to your server IP address.After the parsing takes effect, you need to set up a reverse proxy on the server, pointing the new domain to the internal port being listened to by the running AnQiCMS instance.

For example, if you use the Baota panel, you can follow these steps:

  1. Add a website in the Baota panelSelect the "Website" menu, click "Add Site". Here, you need to fill in the independent domain name of the new site (such asnewsite.com)。In the creation process, the database can usually choose not to create, and the PHP version can be set to "pure static" because the actual content will be processed by AnQiCMS.After the site is created, the system will generate a website root directory for you, for example/www/wwwroot/newsite.com.

  2. Configure the website running directory and reverse proxyEnter the settings interface of the new site.

    • In the "Website Directory" tab, change the runtime directory to the root directory of the site./publicfolder (for example/www/wwwroot/newsite.com/public),and click Save.
    • Switch to the "Reverse Proxy" tab, click "Add Reverse Proxy". Enter an identifier in the proxy name field (such asnewsite_anqicms_proxyFill in the internal address and port that your AnQiCMS instance is listening to, which is usuallyhttps://en.anqicms.comIf your AnQiCMS is listening on a different port, please modify it according to the actual situation.
    • If your server environment is Nginx, it will usually be configured like this:
      
      location @AnqiCMS {
          proxy_pass https://en.anqicms.com;
          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 thatproxy_passpoint to the port where AnQiCMS is actually running.
    • If you are using Apache, the configuration method will be different, usually by configuring VirtualHost and usingProxyPassImplement the instruction, specifically refer to the Apache reverse proxy configuration document.

After completing these server-side configurations, all accessnewsite.comThe request will be forwarded to your AnQiCMS instance.

Add a new site and configure database information in the AnQiCMS backend.

After the preparatory work on the server side is completed, the next step is to create and configure a new site in the AnQiCMS background management system.

  1. Access the backend of the main site.:Enter your AnQiCMS main site domain in the browser and log in to the admin interface.
  2. Enter multi-site management:Find and click the 'Multi-site Management' option in the left navigation menu.
  3. Add a new siteClick the 'Add new site' button, the system will pop up a form, where you need to fill in the information of the new site in detail.
    • Site name: Name a site that is easy to recognize, for example, "Product Display Site".
    • Site root directoryThis item is crucial. It specifies the storage location of independent files of the new site (such as uploaded images, cache files, etc.). To avoid confusion with the existing site, it is necessary to set it up one.Independent and uniqueThe path. If your AnQiCMS is deployed with Docker, the path will usually start with/app/Followed by the domain name, with dots replaced by underscores, for example/app/newsite_com. If deployed directly on the server, it can point to the root directory of the website you created for the new site in the Baota panel, for example/www/wwwroot/newsite.comThis directory must be within the access range of the AnQiCMS instance.
    • website address: Enter the complete domain name of the new site, for examplehttp://newsite.com.
    • Administrator account password: Set up independent backend management accounts and passwords for new sites. This ensures that the management permissions of each site are independent of each other.
    • Database nameThe same, specify a database name for the new siteBrand new and uniqueFor examplenewsite_dbThis will ensure that the data of the new site is stored completely independently, without affecting the main site or other sub-sites.
    • Duplicate database informationIf your AnQiCMS instance has sufficient database management permissions (for example, in Docker deployment, the AnQiCMS container usually usesrootAccount connects to MySQL), you can choose to 'Reuse default database account information'.Thus, AnQiCMS will automatically create a new database and tables for the new site using the database connection information configured for the main site.If you wish to use a completely independent database server or a different database user for the new site, you will need to uncheck this option and manually fill in the corresponding database connection information.
    • Select the template to use: Choose an appropriate template according to the needs of the new site.
  4. Confirm creation: After carefully checking that all information is correct, click the 'Confirm' button to complete the creation of the new site.

After successful creation, you can access the new configured domain (such ashttp://newsite.com/Visit the new site. At the same time, through the "Multiple Site Management" list of the AnQiCMS main site, you can directly click the "Visit Backstage" button to log in to the backend of the new site for independent content management and configuration.

The multi-site management feature of AnQiCMS, combined with independent domain and database configuration, allows you to efficiently operate multiple completely independent websites under one system, greatly enhancing management efficiency and flexibility.


Frequently Asked Questions (FAQ)

Q1: Can I run multiple AnQiCMS instances on the same server instead of using the multi-site management feature?A1: Can. If you want each site to have a completely independent AnQiCMS application instance, you can install each AnQiCMS in a different directory and configure them to listen on different ports (such as 8001, 8002, etc.).Then configure a separate domain and reverse proxy for each instance.But this method will consume more server resources, and it is not as centralized and efficient as the built-in multi-site function of AnQiCMS.The multi-site management function implements the separation of multiple logical sites under a single AnQiCMS application instance, resulting in higher resource utilization.

Q2: Why does each new site need an independent "site root directory"? What is the specific use of this directory?A2: The independent site root directory is the key to ensuring the isolation of new site files.AnQiCMS will store the unique files of each site in this directory, for example: uploaded images and attachments, static cache files, log files, and some site-specific configuration files.The benefit of doing this is that when you manage files for a site (such as clearing cache, backing up uploaded files), it will not affect other sites and it is also convenient to locate and solve specific site issues.

Q3: If I choose to reuse the default database account information, how will AnQiCMS handle the database of the new site?A3: When you choose to reuse the default database account information, AnQiCMS will use the main site to connect to the database

Related articles

How to configure the pseudo-static rules in AnQiCMS to optimize URL structure and include categories, model aliases?

Building a clear, search engine-friendly URL structure in AnQiCMS is a very important aspect of website operation.By reasonably configuring the pseudo-static rules and cleverly integrating categories and model aliases, not only can it enhance the user experience, but it can also significantly optimize the website's SEO performance.AnQiCMS as a high-performance content management system provides flexible pseudo-static features, allowing us to easily achieve these goals.The importance of optimizing URL structure Imagine you visit a website and see this kind of link: `example

2025-11-08

How does AnQiCMS's 'Full Site Content Replacement' feature efficiently handle content strategy adjustments?

Today, with the increasing refinement and diverse strategies of content operation, how to adjust website content efficiently and accurately is a challenge facing every website operator.When brand information is updated, external link adjustments, or SEO strategy iterations occur, manually modifying thousands of contents on the website one by one is not only time-consuming and labor-intensive, but also prone to errors.Fortunately, AnQiCMS provides an extremely powerful tool - the "Full Site Content Replacement" feature, which can help operators with amazing efficiency and accuracy to deal with various content updates and strategy adjustments, and become a "secret weapon" for content management strategy adjustments.###

2025-11-08

How to define and use custom variables in AnQiCMS templates, such as the `{% with %}` tag?

In the template design of AnQi CMS, we often encounter scenarios where we need to temporarily store or pass data.In order to make the template code clearer, easier to read, and more powerful, AnQi CMS provides the mechanism for defining and using custom variables, the most commonly used of which are the `{% with %}` tag and the `{% set %}` tag.They can help us handle data flexibly in templates, avoiding repeated calculations or passing complex objects.

2025-11-08

What is the difference between the `{{variable}}` and `{% tag %}` syntax in AnQiCMS templates?

When using Anqicms to build a website, templates are the key to dynamic content display.We often see two special syntax structures in template files: `{{variable}}` and `{% tag %}`.Although they are all related to the display and processing of data, they play different roles and have different usage methods.Understanding the difference between them is the first step in efficiently using the Anqi CMS template.

2025-11-08

How to implement multi-language content switching and display in AnQiCMS template?

In today's digital world, your website may need to be global for users.AnQiCMS fully understands this requirement and provides powerful multilingual support functions, allowing you to easily build and manage multilingual websites and better serve users from different countries and regions.How to implement multi-language content switching and display in AnQiCMS templates?Let's explore step by step. ### Understanding the multi-language mechanism of AnQiCMS: Handling two types of 'languages' In AnQiCMS, we need to distinguish between two types of 'language' content

2025-11-08

How does AnQiCMS increase the level of content operation automation through the timed publishing function?

Today, with the increasing emphasis on efficiency and user experience, the degree of automation in content operation is directly related to the competitiveness of the website.For many small and medium-sized enterprises and self-media operators, how to ensure high-quality, frequent, and precise targeting of content under limited human resources is a continuous challenge.AnQiCMS is an efficient and flexible content management system, and its built-in timed publishing function exactly provides strong support for solving this problem.Imagine such a scenario: You have meticulously planned marketing content for a week or even a month, including articles, product updates, and event previews.

2025-11-08

How to get the global configuration information of AnQiCMS template, such as the website name and logo?

In AnQiCMS template, cleverly obtain the global configuration of the website to make your website more flexible When designing or maintaining an AnQiCMS website template, we often encounter a need: to display unified global information on each page of the website, such as the name of the website, logo, filing number, or custom contact information.Manually adding this information to each page is not only inefficient but also time-consuming and laborious to update once it needs to be changed.

2025-11-08

How to filter the document list based on category ID, model ID, or recommendation attributes for the `archiveList` tag?

In AnQiCMS, flexibly displaying content is one of the keys to building an efficient website.The `archiveList` tag is such a powerful tool that allows us to filter and display the document list of the website based on various conditions.Whether you want to display a certain type of article on a specific page, or organize information based on content type or editor's recommendations, `archiveList` can provide precise control.### Accurate positioning: Filter document list by category ID When we want to display in a certain area of the website, such as the sidebar or a special topic page

2025-11-08