AnQiCMS, with its efficient and flexible multi-site management feature, provides great convenience to users, especially in scenarios where it is necessary to build independent sites for different brands, products, or services.When you want to configure independent domain names 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

It is crucial to understand why it is essential to configure independent domain names and database information for each new site before discussing specific operations.An independent domain name allows each site to have a unique brand image, which is convenient for users to remember and access. It also benefits search engine optimization (SEO), enabling each site to obtain independent weight and ranking.And an independent database means that the data of each site (such as content, users, settings, etc.) is isolated from each other, without interference.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 master site on your server first.Whether through Docker container deployment (such as using the Docker management feature of 1Panel or Baota panel), or directly deploying manually 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 to complete it first.

Prepare an independent domain and reverse proxy for the new site

Configure a separate domain for the new site, you first need to perform domain resolution, and point the A record of the new domain to your server's IP address.After parsing takes effect, it is necessary to set up reverse proxy on the server, directing the new domain to the internal port being listened to by the running AnQiCMS instance.

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

  1. Add a website to Baota PanelSelect the 'Website' menu, click 'Add Site'. Here, you need to fill in the independent domain name of the new site (for example,newsite.com)。During the creation process, the database can usually select "do not create", and the PHP version can be set to "pure static", because the actual content will be processed by AnQiCMS./www/wwwroot/newsite.com.

  2. Configure the running directory and reverse proxy of the websiteEnter the settings interface of the new site.

    • In the "Site Directory" tab, change the running 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_proxyEnter the internal address and port of your AnQiCMS instance that the target URL listens to, 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 actual port where AnQiCMS is running.
    • If you are using Apache, the configuration method will be different, usually by configuring VirtualHost and usingProxyPassImplementation instructions, please refer to Apache's reverse proxy configuration document for specifics.

After completing these server-level configurations, all accessnewsite.comAll requests will be forwarded to your AnQiCMS instance.

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

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

  1. Access the backend of the main siteEnter your AnQiCMS main site domain in the browser and log in to the admin interface.
  2. Enter Multi-site ManagementFind and click the 'Multi-site Management' option in the left navigation menu.
  3. Add a new siteClick the "Add New Site" button, and the system will pop up a form where you need to fill in the information of the new site in detail.
    • Site NameSet a recognizable name for the new site, for example, "Product Display Site".
    • Site Root DirectoryThis item is crucial. It specifies the storage location for independent files of the new site (such as uploaded images, cache files, etc.). To avoid confusion with the existing site, be sure to set it up.Independent and uniqueThe path. If your AnQiCMS is deployed with Docker, the path usually starts with/app/Start with, followed by the domain dots replaced with underscores, for example/app/newsite_comIf 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 accessible range of the AnQiCMS instance.
    • Website address: Enter the full domain name of the new site, for examplehttp://newsite.com.
    • Administrator account passwordSet an independent admin account and password for the new site. This ensures that the management permissions of each site are independent.
    • Database nameSimilarly, specify one for the new sitebrand new and uniqueThe database name, for examplenewsite_db. This will ensure that the data of the new site is completely independently stored and has no impact on the main site and other sub-sites.
    • Database information reuseIf your AnQiCMS instance has sufficient database management permissions (for example, in Docker deployment, the AnQiCMS container is usually used)rootAccount connection MySQL), you can choose to "Reuse default database account information".Thus, AnQiCMS will use the database connection information configured for the main site to automatically create a new database and tables for the new site.If you want the new site to use a completely independent database server or a different database user, you need to uncheck this option and manually fill in the corresponding database connection information.
    • Select the template to use: Choose a suitable template according to the requirements of the new site.
  4. Confirm creationPlease carefully check all information is correct before clicking the "OK" button to complete the creation of the new site.

After creation, you can access the new site through the newly configured domain (e.g.,)http://newsite.com/Visit the new site.At the same time, through the "Multi-Site Management

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.


Common Questions (FAQ)

Q1: Can I run multiple AnQiCMS instances on the same server instead of using the multi-site management feature?A1: Okay.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 an independent domain name and reverse proxy for each instance.This method will consume more server resources and is not as centralized and efficient in management as AnQiCMS's built-in multi-site feature.The multi-site management function achieves the separation of multiple logical sites under a single AnQiCMS application instance, leading to 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, such as: uploaded images and attachments, static cache files, log files, and some configuration files specific to the site.The benefits of doing this are that when you manage files for a specific 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 'Reuse 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