Easily implement multi-site content management and display in AnQiCMS
For users who operate multiple brands, sub-sites, or content branches, it is a challenge to manage the content of each site uniformly.AnQiCMS provides powerful multi-site management features, allowing you to easily create and maintain multiple independent websites under a single system instance, and flexibly control the way their content is displayed.This article will introduce how to configure multiple sites in AnQiCMS and implement independent content management and display.
1. Preparation: Ensure the AnQiCMS environment is ready
Before starting the configuration of multiple sites, please ensure that an AnQiCMS instance is installed and running on your server.The most recommended way is to use Docker for deployment, which provides a concise and efficient running environment.8001.
In addition, you need to prepare a separate domain name for each new site created under each plan, and ensure that these domains are correctly resolved to your server's IP address.This is the foundation for the normal operation of the multi-site function.
2. Configure reverse proxy: Specify the direction for the new site
The multi-site feature of AnQiCMS is implemented through a single backend management of multiple front-end websites, which means that all website requests will eventually be directed 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 name.
Create a site on Baota panel (for proxy only): Log in to your Baota panel, go to the "Website" menu.To generate an SSL certificate for your new domain name and manage the website directory, you need to click on 'Add Site'.
dev.anqicms.com),and set the root directory to a new path not occupied by other websites (for example/www/wwwroot/dev.anqicms.com)。FTP and database can be optionally not created, choose the PHP version as 'Pure static', and then submit.Remember this newly created site directory, it will be used in AnQiCMS backend later.Configure reverse proxy rules: New site created successfully, click the 'Settings' button on the right side of the site. Find the 'Reverse Proxy' tab in the settings interface and click 'Add Reverse Proxy'.
- Proxy Name:可以随意填写,例如“AnQiCMS代理”。
- Target URL:填写您的AnQiCMS实例监听的地址和端口,通常是
http://127.0.0.1:8001If you modify the running port of AnQiCMS, please fill in the corresponding port number. - Send domainSelect "$host".
- Tick the "Enable Reverse Proxy" option, then click "Submit".
With such configuration, when the user accessesdev.anqicms.comWhen, the Baota panel will forward the request to the AnQiCMS program running locally on port 8001.
3. Add a new site in the AnQiCMS background: define site characteristics
After completing the reverse proxy configuration, we need to register this new site in the AnQiCMS admin panel next.
Log in to the default site's admin panel: Visit the admin 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 site: Click the "Add new site" button, you will see a form that requires you to fill in the details of the new site:
- Site Name:Choose a name that is easy to recognize for your new site.
- Site Root Directory:Here is very critical! Since 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 be
/app/Start at the beginning and it isUniqueThe dot in the domain name should be replaced with an underscore, for example,/app/dev_anqicms_comPlease ensure that this path is consistent with the directory path of the site you created in the Baota panel, but the prefix should be changed to English/app/. - Website addressEnter the complete domain name you have prepared for the new site, for example
http://dev.anqicms.com. - Administrator account/password:For this new site's backend, set up a separate administrator login credential.
- Database name:Similarly, set up a separate database name for the new site, for example
dev_anqicms_comThis ensures that each site has independent data storage. - Database information reuse
- Select the template to use: Choose a default template theme for the new site.
The site has been successfully created by clicking “OK”. At this point, a new independent site has 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 it by clicking the "Access Backend" button in the "Multi-site Management" list, or by directly entering it in the browser.http://dev.anqicms.com/system/Access.
In this independent console, you can manage this new site just like managing 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 unique content models.
- Page Resources:Manage exclusive single-page and media files.
- Function Management:Configure SEO (pseudo-static, TDK), friend links, message forms, and other settings for this site.
- Template Design:Enable or customize templates for this 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 invocation of multi-site content
AnQiCMS's template tag system is very flexible, supporting invocation throughsiteIdparameters to control the display range of content.
- Default behavior:
When you do not specify the parameters in a template of a site
siteIdall content