English CMS (EnglishCMS) is favored by many website operators for its efficient and flexible content management capabilities.Especially its powerful multi-site management feature, combined with Docker containerization technology and reverse proxy, allows you to easily set up and manage multiple independent websites on a single server, greatly enhancing operational efficiency and reducing maintenance costs.
Learn the charm of multi-site
Imagine that you might have several websites of different brands, targeting different audiences, or serving different regions, but their content updates and management processes are roughly the same.If each website is deployed independently, not only does it consume a large amount of resources, but it is also quite cumbersome to manage.AnQiCMS's multi-site feature is designed to address 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 that you can focus on maintaining an AnQiCMS system while simultaneously operating multiple seemingly independent websites.This unified management approach greatly reduces repetitive work, optimizes resource allocation, and makes cross-site data sharing and resource integration extremely convenient.Whether it is expanding new business lines or carrying out content promotion in multiple languages and regions, the multi-site capability of AnQiCMS can provide solid support.
Docker and Reverse Proxy: The Perfect Match
To fully utilize the advantages of AnQiCMS's multi-site feature, Docker and reverse proxy are an indispensable 'perfect match'.
Firstly,DockerContainer technology brings 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 upgrade exceptionally simple and secure.For multi-site scenarios, only one AnQiCMS Docker container needs to be started, and it has the ability to serve multiple websites.
Secondly,reverse proxyHere plays the role of a "traffic director".Without reverse proxy, if a Docker container only exposes one port (for example, the default 8001 port of AnQiCMS), all external requests can only access the same service through this port.site1.com/site2.com)when it is necessary, a reverse proxy is required to route traffic to the correct backend service based on different domain names.In our scenario, all different domain names will be received by the reverse proxy server, which will then intelligently forward these requests to the same AnQiCMS Docker container. The AnQiCMS will then identify and display 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: Run multiple websites
Now, let's take a step-by-step look at how to make the multi-site feature of AnQiCMS truly work through Docker and reverse proxy.We take the common Baota panel as an example, because it integrates Docker management and reverse proxy configuration, making the operation relatively intuitive.
Step 1: Preparation - Docker environment and MySQL
Before starting, please make sure that the Baota panel is installed on your server and that the Docker service within the panel is running.English translation: Since AnQiCMS requires database support, please install a MySQL container from the Docker App Store.Please note the password for the root user when installing MySQL, which 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 usage.
Step 2: Deploy the first AnQiCMS instance
Next, deploy your first AnQiCMS instance through the Docker container feature of the Baota panel.
- Enter the 'Docker' interface of the Baota panel, select the 'Container' tab, and click 'Create Container'.
- Enter container information:
- Name:It can be
anqicms-mainOr any name you like. - Image:手动输入
anqicms/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.
- Name:It can be
- Set the restart policy to "Restart on Failure" or "Restart if Not manually stopped", to ensure service stability.
- Confirm creation and wait for the container to start.
Step 3: Configure reverse proxy for the first website
After the container starts running, we need to configure domain access for your first website.
- In the left menu of the Baota panel, click "Website", then click "Create Website".
- Select the "Reverse Proxy" type.
- Main Domain:Enter your first website domain, for example,
main.yourdomain.com. - Proxy address:Fill in
http://127.0.0.1:8001.127.0.0.1指向您的服务器本地,8001是AnQiCMS Docker容器暴露的端口。 - Click to confirm, complete the creation of the site. Now, visiting your domain should display the initialization installation interface of AnQiCMS.Complete the database configuration and administrator account setup according to the instructions.Database information should use the root password of the MySQL container installed in the first step.
第四步:在AnQiCMS内部添加新站点
The first website is installed, log in to its backend. This is the core: we will create more websites in an AnQiCMS instance.
- In the AnQiCMS backend left menu, find the 'Multi-site Management' feature, and click 'Add New Site'.
- In the popped-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 data for the new website, please use
/app/Start with your domain name (replace dots with underscores), for example/app/dev_anqicms_comEnsure that this directory name is unique. - Website address:The full domain name of your new website, for example
http://dev.anqicms.com. - Administrator account password:Set up a separate admin account and password for this new website.
- Database name: It is also very important!A new website needs an independent database to store its content. It is recommended to name it with your domain (replace dots with underscores), such as
dev_anqicms_com. - **Database Information**