AnQiCMS is an efficient enterprise-level content management system, and its multi-site management function is undoubtedly an important tool for many enterprises and operators to improve efficiency and segment the market.By creating and managing multiple independent sites under an AnQiCMS instance, we can flexibly provide customized content display and services for users of different brands, business lines, or regions.
Understand the core concept of multi-site management in AnQiCMS
AnQiCMS multi-site management is not simply copying multiple systems, but ratherUnder a unified AnQiCMS backend framework, run and manage multiple logically independent websitesThis means that, although you have only installed one set of AnQiCMS program, but through clever configuration, it can intelligently display the independent content, style, and even background management permissions of the corresponding site according to the domain name visited by the user.The core advantage of this model lies in its significant reduction in operation and maintenance costs and repetitive work, while also ensuring a high degree of independence in the presentation of each site on the front end.
Imagine that you might need a corporate website, a product showcase site, and a blog, all serving the same company, but with different content focuses and target audiences.Take advantage of the multi-site feature of AnQiCMS, you can easily meet all these needs on a single platform, each site has its own database, administrator account, content model, and template, and the content between them does not interfere with each other, making management centralized and efficient.
Deployment basis: Allow AnQiCMS instances to support multi-site operation
Implement the independent display of multi-site AnQiCMS, first you need to ensure that your AnQiCMS instance can respond to requests from different domain names. Normally, an AnQiCMS instance will listen on a specific port (such as the default one, 80 or 443).8001To allow different domains to access this AnQiCMS instance and distribute it to their respective logical sites, we need to make use ofReverse Proxytechnology.
Reverse proxy servers (such as Nginx, Apache, etc.) play the role of a "traffic scheduler".It will forward the request to the port listened by the AnQiCMS instance based on the domain name visited by the user.No matter how many site domain names you have, they will all be pointed to by reverse proxyThe same AnQiCMS running portThis means you only need to maintain one AnQiCMS core program, without the need to install a separate one for each site.
For example, if you use Baota panel or 1Panel and other tools to deploy AnQiCMS, you need to set up a reverse proxy for the core service of AnQiCMS so that it can be accessed through such as127.0.0.1:8001This address is accessed. All subsequent newly created site domains will be directed to this through their respective reverse proxy configurations127.0.0.1:8001.
Create a new independent site in the AnQiCMS backend
After the basic deployment is completed, you can officially create a new site in the AnQiCMS backend. This process is intuitive and flexible, simply log in to the backend of the AnQiCMS site you initially installed (usually referred to as the "master site" or "default site"), then:
- Find and click in the left navigation menu“Multi-site management”Feature.
- Click after entering the multi-site management page“Add new site”button.
At this time, the system will pop up a form, where you need to fill in key information for the new site:
- Site Name:This is the name used for background management and identification, you can name it according to your business needs, such as "Product Show Site", "Company Blog", etc.
- Site root directory:This is a very important setting that determines the physical storage path of independent files for the new site (such as cache, uploaded files, etc.). It is recommended that
/app/Start (if you are deploying in a Docker environment), followed by replacing the dot with an underscore in the domain name, for example/app/dev_anqicms_com.Make sure that the root directory of each site is unique to avoid data confusion or conflicts. - Website address:Enter the complete access URL of the new site, for example
http://dev.anqicms.comThis URL must be resolved to the domain name of your server. - Admin account password:Set an independent admin account and password for the new site. This means that each sub-site can have an independent administrator team and permissions, achieving fine-grained management.
- Database name:Similarly, this also reflects the independence of the content data of the new site. It is recommended to use naming conventions similar to the site root directory, for example
dev_anqicms_comEnsure each site has an independent database, with content that does not interfere with each other. - Database information reuse: If your database account has sufficient privileges (such as reusing the default root account information when deploying Docker), you can choose to reuse the default database account information to simplify configuration.
- Select the template to use:You can choose a preset template for the new site, or upload a customized template to give each site a unique visual style and layout.
Fill in and confirm this information, and AnQiCMS will create a brand new, logically independent site for you.
Configure reverse proxy for the new site to enable access
After the new site is created successfully in the AnQiCMS background, although the content and database have been independent, users cannot access it directly through the domain name. This requires going back to your server management panel (such as Baota panel, 1Panel, etc.) to configure the domain name for the new siteReverse Proxy:
Create a new website in the panel, enter the domain you set for the new sitewebsite addressfor example
dev.anqicms.com)For panels like Baota that need to be specifiedRunning directoryPlease set the run directory to the root directory specified when the site was created.
/publicfolder (for example/www/wwwroot/dev.anqicms.com/public), and save the configuration. This step ensures that static resources can be accessed correctly.ConfigurationReverse proxy rulesThis is the most critical step, you need to forward all requests to the new domain name through reverse proxy to the unified port that the AnQiCMS instance is listening to (for example
http://127.0.0.1:8001)。An example of a specific Nginx configuration might look like this:location @AnqiCMS { proxy_pass http://127.0.0.1:8001; 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; }This configuration will try to find static files first, and if not found, it will proxy the request to the AnQiCMS instance。
Configure reverse proxy and restart your web server (Nginx/Apache) and then you can access the new domain from the front end and manage the new site. Each site will have an independent backend login entry (such ashttp://dev.anqicms.com/system/)