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 usuallyhttp://127.0.0.1:8001If 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 http://127.0.0.1:8001;
          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