AnQiCMS (AnQiCMS) is favored by many website operators for its efficient and flexible content management capabilities.Especially its powerful multi-site management function, combined with Docker containerization technology and reverse proxy, allows you to easily set up and manage multiple independent websites on the same server, greatly enhancing operational efficiency and reducing maintenance costs.

Learn the charm of multi-sites

Imagine that you might have several different brands, targeting different audiences or serving different regions, but they have roughly the same content update and management processes.If each website is deployed independently, not only does it consume a lot of resources, but it is also quite cumbersome to manage.The multi-site feature of AnQiCMS is exactly to solve this pain point.

It allows you to create multiple independent websites within an AnQiCMS system instance, each with its own domain, content, template, and even management team.This means, you can focus on maintaining an AnQiCMS system while simultaneously operating multiple seemingly independent websites.This unified management approach greatly reduces redundant work, optimizes resource allocation, and makes cross-site data sharing and resource integration extremely convenient.Whether it is to expand new business lines or to promote content in multiple languages and regions, AnQiCMS' multi-site capabilities can provide solid support.

Docker and reverse proxy: a golden partner

To fully leverage the advantages of AnQiCMS multi-site, Docker and reverse proxy are indispensable 'golden partners'.

first, DockerContainer technology has brought unprecedented convenience to the deployment of AnQiCMS.It packages AnQiCMS and all its dependencies into a lightweight, portable container, achieving isolation between the application and the runtime environment.This means that no matter what your server environment is, AnQiCMS can run consistently and avoid complex environment configuration issues.Build once, run anywhere, making deployment and upgrades extremely simple and secure.For multi-site scenarios, simply starting an AnQiCMS Docker container enables it to serve multiple websites.

secondly,Reverse ProxyHere, he acts as a 'traffic guide'. Without a reverse proxy, if a Docker container only exposes one port (such as the default 8001 port of AnQiCMS), then all external requests can only access the same service through this port.However, when you have multiple domains (such assite1.com/site2.comWhen that happens, you need a reverse proxy to route traffic to the correct backend service based on different domain names.In our scenario, all different domain names are received by the reverse proxy server, which then intelligently forwards these requests to the same AnQiCMS Docker container. AnQiCMS then identifies and displays the corresponding independent website content based on the domain name of the request.This effectively resolves the port conflict issue and allows you to use the standard 80 or 443 ports for each website.

Configuration steps: Make multiple websites run

Now, let's go step by step to see how to make the multi-site function of AnQiCMS truly work through Docker and reverse proxy.We take the common Baota panel as an example, as it integrates Docker management and reverse proxy configuration, making the operation relatively intuitive.

First step: Preparation - Docker environment and MySQL

Before you start, please make sure that the Baota panel is installed on your server and that the Docker service within the panel is running.At the same time, since AnQiCMS requires database support, please install a MySQL container in the Docker App Store.Please note the password for the root user when installing MySQL, as it will be used later when installing AnQiCMS.If your server memory configuration is not high, it is recommended to choose MySQL 5.6 version to reduce resource consumption.

Second step: Deploy the first AnQiCMS instance

Next, deploy your first AnQiCMS instance through the Docker container feature of the Baota panel.

  1. Enter the "Docker" interface of the Baota panel, select the "Container" tab, and click "Create Container".
  2. Enter container information:
    • Name:can beanqicms-mainOr any name you like.
    • Image:Manual inputanqicms/anqicms:latest.
    • Port:Select "Expose Port", fill in both the server and container ports.8001(This is the default internal running port of AnQiCMS).If you plan to run multiple AnQiCMS containers on the server (instead of a single container hosting multiple sites), the server ports need to be distinguished.
  3. Set the restart policy to "Restart after failure" or "Restart if not manually stopped", to ensure service stability.
  4. After confirmation, wait for the container to start.

Step 3: Configure reverse proxy for the first website

After the container is running, we need to configure domain access for your first website.

  1. In the left menu of the Baota panel, click "Website" and then click "Create Website".
  2. Select the "Reverse Proxy" type.
  3. Primary Domain:Enter your first website domain name, for examplemain.yourdomain.com.
  4. Proxy Address:Fill inhttp://127.0.0.1:8001. Here127.0.0.1Point to your server locally,8001Is the port exposed by the AnQiCMS Docker container.
  5. Click confirm to complete the creation of the site. Now, visit your domain and you should see the AnQiCMS initial installation interface.Follow the instructions to complete the database configuration and set up the administrator account.Database information please use the root password of the MySQL container you installed in the first step.

Step 4: Add a new site inside AnQiCMS

After the first website is installed, log in to its backend. This is the core: we will create more websites in an AnQiCMS instance.

  1. In the AnQiCMS backend left menu, find the 'Multi-site Management' feature, click 'Add New Site'.
  2. In the pop-up interface, fill in the following information carefully:
    • Site Name:The name of the new website.
    • Site root directory: Very important!This is a directory independent of other sites, used to store cache and other data for the new website. Please use/app/Start by adding your domain name (replace dots with underscores), for example/app/dev_anqicms_comMake sure this directory name is unique.
    • Website address:For example, the complete domain name of your new website,http://dev.anqicms.com.
    • Admin account password:Set up a separate admin account and password for this new website.
    • Database name: Very important as well!A new website needs an independent database to store its content. It is recommended to name it with your domain (replacing dots with underscores), for exampledev_anqicms_com.
    • **Database Information