AnQiCMS provides powerful multi-site management features, allowing you to easily operate multiple independent websites within the same system, each with its own domain and content.This is undoubtedly an extremely convenient and efficient solution for operators who have multiple brands, sub-sites, or need to provide differentiated content for different audience groups.Through a unified backend management entry, you do not have to deploy a separate system for each site, which greatly simplifies operation and maintenance work, while ensuring the complete independence of the front-end content display.
Next, we will discuss in detail how to configure multiple sites in AnQiCMS, ensuring that the content under each domain can be displayed independently, without interference.
Understanding the core advantages of AnQiCMS multi-site management
Before going into the detailed configuration, let's first clarify the core value that AnQiCMS multi-site management brings to you.It is not just a simple way to manage multiple websites, but more importantly, it has achieved the isolation of content and data.
- Content independent: Each site has independent article, product, page, category, and tag data, and you can publish exclusive content based on the positioning of different sites.
- Domain Independent:Each site can be bound to different domain names, realizing brand or business differentiation.
- Management centralization:Even though the content is independent, the management of all sites can be carried out on the same AnQiCMS backend, making operations convenient and more efficient.
- Resource sharing and customization:Although the content is independent, the underlying system resources (such as servers, database connection pools) can be shared, and each site can flexibly choose or customize its own template to achieve personalized display.
In short, the multi-site feature of AnQiCMS aims to provide a solution that can be both centrally managed and highly content-independent.
Prepare your server environment
Before adding a new site in AnQiCMS, you need to ensure that the server environment is ready for the new domain name.The key step is to configure reverse proxy to correctly forward access requests to the running AnQiCMS application.
No matter whether you deploy AnQiCMS directly in a Linux environment or through Docker containers (such as using Baota Panel, 1Panel, aaPanel, etc.), the core idea is the same:
Parse new domain name:Firstly, point the domain name you plan to use for the new site to your server IP address.
Configure reverse proxy:
For Nginx or Apache users:You need to add a reverse proxy rule for the new domain in the configuration file of the web server. This rule will listen to HTTP/HTTPS requests for the new domain and forward them to the port that AnQiCMS is listening on (the default port for AnQiCMS is usually)
8001).- For example, using Nginx, you will find
nginx.confAdd a configuration section similar to the following in the standalone site configuration file, make sureproxy_passThe internal address and port pointing to AnQiCMS:
server { listen 80; server_name new.anqicms.com; # 您的新域名 root /www/wwwroot/new.anqicms.com/public; # 建议为新站点设置独立的公共目录 location @AnqiCMS { proxy_pass http://127.0.0.1:8001; # AnQiCMS 应用监听的端口 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,
rootThe catalog is usually pointed to the root directory of the new site for storing static resources in actual multi-site configurations.publicFolder, this is a concept different from the 'Site Root Directory' set in the AnQiCMS backend. The latter is the logical directory used by AnQiCMS to store its own data (such as cache, uploaded files).- For example, using Nginx, you will find
For users of Baota Panel, 1Panel, or aaPanel:These panels usually provide a graphical interface to simplify the configuration of reverse proxies. You can create a new reverse proxy site in the "Website" or "Reverse Proxy" module, and bind the new domain to
127.0.0.1:8001(If your AnQiCMS runs on a different port, please modify accordingly).These panels will also handle the underlying configuration and pseudo-static rules of Nginx/Apache.
After completing the reverse proxy configuration, you need to restart your web server (Nginx or Apache) to make the changes take effect.At this time, accessing the new domain through the browser should display the AnQiCMS installation wizard or the default site interface, indicating that the request has been successfully forwarded to AnQiCMS.
Add a New Site in AnQiCMS Admin Panel
The server environment is ready, then create a new site in AnQiCMS backend after that:
- Log in to the default site backend:Use your primary domain or any existing site domain to log in to the AnQiCMS backend management system (for example
yourdomain.com/system). - Enter multi-site management:Find and click the "Multi-site Management" feature in the left navigation menu. Here, all configured sites will be listed.
- Add a new site:Click the "Add new site" button on the page. You will see a form that requires you to fill in the details of the new site:
- Site Name:Specify an easily identifiable name for your new site, such as "Product Display Site" or "Company Sub-brand A". This helps you quickly distinguish different sites in the background.
- Site root directory:This is a very critical setting used to independently store cache, uploaded files, logs, and other data for a new site. To ensure complete independence of content and data,Ensure that each site has a unique site root directory.It is recommended that the path be
/app/Starting (if AnQiCMS is deployed in Docker, this is its internal path), and combine it with the domain name, for example/app/new_anqicms_com. - Website address:Enter the complete access address of the new site, i.e., the new domain name you previously configured for reverse proxy, for example
http://new.anqicms.com. - Administrator account password:Set up a separate backend management account and password for this new site. This means that even though the content and database of the new site are independent, you can also assign a separate administrator to manage it.
- Database name:Similarly, in order to achieve data independence, you need to specify anew, unused database name. Similar to the root directory of the site, it is recommended to name it with the domain name or site name, for example
new_anqicms_db. - Database information reuse:Selecting “Reuse default database account information” is usually recommended, especially when your AnQiCMS instance (especially Docker deployment) already has full management permissions for the database, in which case there is no need to re-enter the database connection credentials.If you wish to use a different database server or account for the new site, you can uncheck and fill in manually.
- Select the template you want to use:Select a template suitable for the new site from the drop-down list.AnQiCMS supports flexible template switching, you can choose different themes for each site, even customizing exclusive templates.
- Confirm creation:Please carefully check all the information filled in, especially the uniqueness of the site root directory and the database name, and then click the "OK" button to complete the creation of the new site.
Visit and manage your new site
Site created successfully. You can now access the front-end page through the new domain.
- Access front-end:Enter your newly bound domain in the browser (for example,
http://new.anqicms.com),You will see the front-end content of the new site. Since the data is independent, it will display a completely new, unfilled site interface (or the default content of the template you choose). - Access the backend:Access the backend address of the new site, usually
您的新域名/system/(For example}]}http://new.anqicms.com/system/). Log in with the administrator account and password you set when creating the site.
After logging into the backend of the new site, you will find that its content management module (documents, categories, pages, etc.) is completely blank, waiting for you to fill in exclusive content.This means that all content operations for the new site will be performed in its independent backend environment, completely isolated from the main site's data, achieving truly independent content display.
Content is independent of the template application
Through the above configuration, the new site has been completely separated from the default site at the data level.This means that any articles, products, pages, or categories you publish in the new site backend will only be displayed under the new site's domain.
In terms of template design, AnQiCMS supports each template directory to contain oneconfig.jsonThe file describes the template information, and you can select a different template for each site.This means you can create a unique user interface and experience for each site, further enhancing the independence and brand recognition of its content.
Although this article mainly focuses on independent content display, it is worth mentioning that the template tags of AnQiCMS (such asarchiveList/categoryList) also providesiteIdParameter. In some advanced scenarios, if you need to display specific content on a certain site,other sitesyou can specifysiteIdThe parameter is used to implement cross-site data calls, but by default, each site's tag call will act on its own site's data.
AnQiCMS's multi-site management feature allows you to enjoy the convenience of centralized management while also easily dealing with the complex content operation needs of multiple brands and business lines. Ensure that the content under each domain is presented to the end users in an independent and customized manner.
Common Questions and Answers (FAQ)
1. What is the difference between the multi-site feature of AnQiCMS and installing multiple independent AnQiCMS instances on the same server?AnQiCMS's multi-site feature allows you touse the same AnQiCMS application instanceBelow, manage multiple websites that have independent domains and content (including databases and storage directories).This means that only one AnQiCMS application is running, sharing some underlying resources (such as Go application processes, some configurations).While installing multiple independent AnQiCMS instances, it is equivalent to deploying multiple completely independent AnQiCMS applications on the server, each with its own process, port, database, and filesystem.The multi-site function is isolated at the software level, while multiple instances are isolated at the physical level.The multi-site function saves server resources and has a unified management entry, suitable for scenarios where content relevance is not strong but managers want to centralize management.
2. Can I share some content between different sites?By default, the multi-site design of AnQiCMS is intended to achieve content independence. However, for certain special requirements, AnQiCMS's template tags (such asarchiveList/categoryList/pageListauto providedsiteIdParameters. By explicitly specifying in the tag.siteIdYou can try to call it in the current siteother sitesThe specific content.This requires your template developer to customize it according to business logic to ensure the accuracy and security of data display, and this sharing is usually one-way (from a source site to a destination site).
3. If I change the template of one site, will it affect other sites?Will not.AnQiCMS allows each site to independently select and use different templates.When you create a new site, you specify the template it will use.You can change or modify the current site template at any time in the new site's backend management. These operations will only affect the appearance and layout of the current site and will not affect any other configured sites.This design provides great flexibility, allowing each site to have a unique user experience.