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 a very 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 need to deploy a separate system for each site, which greatly simplifies the operation and maintenance work, while also ensuring the complete independence of the front-end content display.
Next, we will discuss in detail how to configure multiple sites in AnQiCMS to ensure that the content under each domain can be displayed independently without interference.
Understand the core advantages of AnQiCMS multi-site management
Before delving into the configuration, let's first clarify the core value that AnQiCMS multi-site management brings to you.It is not just simple to manage multiple websites, but more importantly, it has realized the isolation of content and data.This means:
- Content independent:Each site has independent articles, products, pages, categories, and tag data. You can publish exclusive content based on the positioning of different sites.
- Domain independent:Each site can be bound to different domain names to achieve differentiation in brand or business.
- Management centralized:Although 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, AnQiCMS's multi-site feature aims to provide a solution that can be both centrally managed and highly independent in content.
Prepare your server environment
Before adding a new site in AnQiCMS, you need to make sure the server environment is ready for the new domain name.The key step is to configure the reverse proxy to correctly forward access requests to the running AnQiCMS application.
No matter whether you deploy AnQiCMS directly in the Linux environment or through Docker containers (such as using Baota panel, 1Panel, aaPanel, etc.), the core idea is the same:
Resolve new domain:First, resolve 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 Web server configuration file. This rule will listen to the HTTP/HTTPS requests of the new domain and forward them to the port that the AnQiCMS application is listening on (the default port for AnQiCMS is usually
8001)- For example, with Nginx, you will
nginx.confadd a configuration section similar to the following in a standalone site configuration file, make sureproxy_passthe internal address and port point 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 directory in the actual multi-site configuration usually points to the root directory of the new site for storing static resourcespublicFolder, this is a different concept from the "Site Root Directory" set in the AnQiCMS backend, which is the logical directory used by AnQiCMS to store its own data (such as cache, uploaded files).- For example, with Nginx, you will
For Baota panel, 1Panel, or aaPanel users:These panels typically provide a graphical interface to simplify the configuration of reverse proxies. You can create a new reverse proxy site and bind a new domain to the
127.0.0.1:8001(If your AnQiCMS is running 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) for the changes to take effect.At this time, accessing the new domain name through the browser should display the AnQiCMS installation wizard or the interface of the default site, indicating that the request has been successfully forwarded to AnQiCMS.
Add a new site in AnQiCMS backend
After the server environment is ready, proceed to create a new site in the AnQiCMS backend:
- Log in to the default site backend:Log in to the AnQiCMS backend management system using your main domain or any existing site domain (for example
yourdomain.com/system) - Enter multi-site management:In the left navigation menu, find and click the 'Multi-site Management' feature. Here will be listed all configured sites.
- 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 recognizable 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,You must set a unique site root directory for each site.It is recommended to start the path with
/app/The beginning (if AnQiCMS is deployed in Docker, this is its internal path), and combined with the domain name, for example/app/new_anqicms_com. - Website address:Enter the complete access address of the new site, that is, the new domain name you previously configured for reverse proxy, for example
http://new.anqicms.com. - Admin account password:Set up a separate admin account and password for this new site. This means that even if the content and database of the new site are independent, you can assign a separate administrator to manage it.
- Database name:In order to achieve data independence, you need to specify a new site fora new, unused database name. Similar to the site root directory, it is recommended to name it with a domain name or site name, for example
new_anqicms_db. - Database information reuse: Check the option 'Reuse default database account information' is usually recommended, especially when your AnQiCMS instance (especially Docker deployment) already has full management permissions for the database, and 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 to use:Select a template suitable for the new site from the drop-down list. AnQiCMS supports flexible template switching, allowing you to 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, then click the "OK" button to complete the creation of the new site.
Access and manage your new site
After the site is created successfully, you can now access the front-end page through the new domain.
- Access the front-end:Enter the new domain you have bound 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 brand 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/) Use the administrator account and password you set when creating the site to log in.
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 carried out in its independent backend environment, completely isolated from the data of the main site, 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 post in the new site's backend will only be displayed under the new site's domain.
In terms of template design, AnQiCMS supports a directory containing one for each set of templatesconfig.jsonFiles are used to describe template information, and you can choose different templates for each site.This means you can create a unique user interface and experience for each site, further strengthening the independence of its content and brand recognition.
Although this article mainly focuses on the independent display of content, it is worth mentioning that the template tags of AnQiCMS (such asarchiveList/categoryList) also providesiteIdThe parameter. In some advanced scenarios, if you need to display specific content on a siteother sitesyou can specifysiteIdParameters to implement cross-site data calls, but by default, each site's tag call will act on its own site's data.
The multi-site management function of AnQiCMS 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. It ensures that the content under each domain name is presented to the end users in an independent and customized manner.
Frequently Asked Questions (FAQ)
1. What is the difference between AnQiCMS's multi-site feature and installing multiple independent AnQiCMS instances on the same server?The multi-site feature of AnQiCMS allows you toin the same AnQiCMS application instanceManage multiple websites with independent domains and content (including databases and storage directories).This means that only one AnQiCMS application is running, sharing some of the underlying resources (such as the Go application process, some configurations).And installing multiple independent AnQiCMS instances means deploying multiple completely independent AnQiCMS applications on the server, each with its own process, port, database, and file system.The multi-site function is logically isolated at the software level, while multiple instances are physically isolated.The multi-site function saves more server resources and a unified management entry, suitable for scenarios where content relevance is not strong but managers wish to manage centrally.
2. Can I share some content between different sites?By default, AnQiCMS's multi-site design is to achieve independent content. However, for certain special requirements, AnQiCMS's template tags (such asarchiveList/categoryList/pageListProvidedsiteIdSpecify through the tag.siteIdYou can try to call it on the current site.other sitesThe specific content. But this requires your template developer to customize according to business logic to ensure the accuracy and security of the data display, and this sharing is usually one-way (from a source site to a target site).
3. Will changing the template of one site affect the others?I can't. 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 template of the current site at any time in the background management of the new site, and 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.