Easily implement multi-site content management and display in AnQiCMS
For users managing multiple brands, sub-sites, or content branches, it is a challenge to unify the management of content across all sites.AnQiCMS provides powerful multi-site management functionality, allowing you to easily create and maintain multiple independent websites under a single system instance and flexibly control the display of their content.This article will introduce in detail how to configure multiple sites in AnQiCMS and implement independent management and display of content.
1. Prepare: Ensure the AnQiCMS environment is ready
Before starting to configure multiple sites, make sure that an AnQiCMS instance is installed and running on your server.The most recommended way is to use Docker deployment, which can provide a simple and efficient running environment.Generally, an AnQiCMS instance listens to a specific port, such as the default one8001.
In addition, you need to prepare a separate domain name for each new site created under each plan, and these domains should be correctly resolved to your server IP address.This is the basis for the normal operation of the multi-site function.
2. Configure reverse proxy: Point the direction for the new site
The multi-site feature of AnQiCMS is implemented through a single backend to manage multiple frontend websites, which means that all website requests ultimately lead to the same AnQiCMS program.In order for different domain names to access the corresponding site content correctly, we need to configure reverse proxy for each new domain.Here is an example using the Baota panel to demonstrate how to set up reverse proxy, the principle is similar for other environments (such as manually configuring Nginx or Apache):
Create a site on the Baota panel (only for proxy)Log in to your Baota panel, go to the "Website" menu.To generate an SSL certificate for your new domain and manage the website directory, you need to click 'Add Site'.In the pop-up window, enter the new site domain (for example
dev.anqicms.comSet the root directory to a new path not occupied by other websites (for example)/www/wwwroot/dev.anqicms.com). FTP and database can be chosen not to be created, select the "pure static" PHP version, and then submit.Remember this newly created site directory, it will be used in the AnQiCMS backend later.Configure reverse proxy rulesAfter the new site is created, click the "Settings" button on the right side of the site. In the settings interface, find the "Reverse Proxy" tab and click "Add Reverse Proxy".
- Proxy Name: Fill in at will, for example, "AnQiCMS proxy".
- Target URL: Fill in the address and port that your AnQiCMS instance is listening on, which is usually
http://127.0.0.1:8001. If you have modified the AnQiCMS running port, please fill in the corresponding port number. - Send domain: Select "$host".
- Check "Enable reverse proxy" and then click "Submit".
With such configuration, when the user accessesdev.anqicms.comAt that time, the Baota panel will forward the request to the AnQiCMS program running locally on port 8001.
3. Add a new site in the AnQiCMS backend: define site characteristics
After completing the reverse proxy configuration, we need to register this new site in the AnQiCMS management backend next.
Log in to the default site's management backend: Visit the backend address of your AnQiCMS default site (for example
http://your-main-domain.com/system/), log in with the admin account.Enter multi-site management: Find and click the "Multi-site Management" feature in the left menu.
Add a new siteClick the "Add new site" button and you will see a form that requires you to fill in the details of the new site:
- Site nameChoose a name for your new site that is easy to recognize.
- Site root directoryHere is very critical! As AnQiCMS runs in Docker and needs to provide independent storage space for each site's data (such as cache, uploaded files, etc.), this directory path must end with
/app/starts and isUnique. It is recommended to replace the dot in the domain name with an underscore, for example,/app/dev_anqicms_com. Make sure this path matches the directory path of the site you created in the Baota panel, but change the prefix to/app/. - website address: Enter the complete domain name you have prepared for the new site, for example
http://dev.anqicms.com. - Administrator account/password: Set an independent administrator login credential for the new site's backend.
- Database name: Similarly, set an independent database name for the new site, for example.
dev_anqicms_com. This ensures that each site has independent data storage. - Duplicate database informationIf you are installed with Docker and the database is in the same network as the AnQiCMS container, you can usually choose to 'reuse the default database account information', because the Docker container can access the same database service.If your database is deployed independently, you need to fill in the connection information manually.
- Select the template to use: Choose a default template theme for the new site.
After filling in, click "OK" to complete the creation of a new site. At this point, a new independent site has already been successfully added to your AnQiCMS system.
4. Independent management and configuration of multi-site content
Once the new site is created successfully, it will have an independent management backend. You can directly enter by clicking the "Access Backend" button in the "Multi-site Management" list, or you can directly enter it in the browser.http://dev.anqicms.com/system/Access.
In this independent dashboard, you can manage this new site just like you would manage a single website:
- Global SettingsConfigure the site name, logo, filing number, copyright information, etc.
- Content Management: Independently publish articles and products, create categories and tags, and define a unique content model.
- Page Resources: Manage exclusive single pages and media files.
- function managementConfigure SEO (pseudo-static, TDK), friend links, message forms, etc. for the site.
- template designEnable or customize templates for the site.
This means that each site can have its own brand image, content strategy, and SEO optimization without switching between different systems.
5. Flexible display and calling of multi-site content
The template tag system of AnQiCMS is very flexible, supportingsiteIdparameter control of content display range.
- Default behaviorWhen you do not specify the parameters in a template on a site
siteIdall content will be used