AnQiCMS is an efficient and flexible content management system, and its multi-site management function is designed to meet the needs of small and medium-sized enterprises, self-media operators, and users with multiple brands or content branches.As a senior website operations manager, I am well aware of the importance of efficiently managing multiple sites on the same server, which not only saves server resources but also simplifies daily maintenance work.Below, I will elaborate on how to install and manage multiple AnQiCMS sites on the same server.
Understanding the multi-site management mechanism of AnQiCMS
The multi-site management feature of AnQiCMS lies in allowing a single AnQiCMS application instance to manage and present multiple independent website contents by distinguishing different domain names.This means you do not need to deploy a complete AnQiCMS code and runtime environment for each site, just run one main AnQiCMS application and add and configure additional sites through its backend interface.Each new site will have an independent database, file storage directory, and management backend, but they share the same performance and features of the AnQiCMS core application.This design greatly improves resource utilization and management efficiency.
Preparation work
Before starting the installation and configuration of multiple AnQiCMS sites, please ensure that your server meets the following basic requirements:
First, prepare the independent domain names for all sites and resolve them correctly to your server IP address.Secondly, ensure that MySQL database is installed on your server and you have sufficient permissions to create new databases and users.If you use Docker for deployment, please make sure that the Docker environment is ready.Finally, you need to deploy a web server such as Nginx or Apache as a reverse proxy for AnQiCMS so that you can access your site through a domain name instead of a port.
Deploy the main AnQiCMS application
The first step in managing multiple sites is to deploy a main AnQiCMS application instance.This instance will carry the core logic of all sites.It is recommended to use Docker for deployment as it has good isolation and is easy to deploy.
For example, using Baota Panel or 1Panel, you can install AnQiCMS in Docker version from the app store.During the installation process, you need to specify a domain name and port (for example, 8001).This main application is deployed, and you will get the first AnQiCMS site.Please record the MySQL root password, as it may be needed when creating new sites later, especially in cases where database information is reused in Docker environments.
If you choose to manually deploy AnQiCMS as a Go project or install it via the command line, the process is similar: download the AnQiCMS Linux installation package, unzip it, configure it to run as a daemon, and make sure Nginx or Apache is configured with reverse proxy, forwarding external domain requests to the port that AnQiCMS is listening on.
Add a new site in AnQiCMS backend
After the main AnQiCMS application runs successfully and is accessible, you can log in to its backend to add a new site.
Log in to the administration backend of your first AnQiCMS site (usually您的主域名/system/)。Find and click the "Multi-site Management" feature in the left menu.Next, click the "Add new site" button, and you will see a configuration form that requires you to fill in the details of the new site.
Here, the 'site name' can be filled in according to your actual needs, used for background distinction; 'Site root directory' is a very critical configuration, it must be unique, used for independent storage of new site cache, uploaded files and other data. For example, if you use Docker, you can fill in/app/新站点域名_com(Replace the dots in the domain name with underscores); If it is a Baota panel environment, it is recommended to create a new website directory, such as/www/wwwroot/newsite.com.
Enter the full domain name of the new site, for examplehttp://newsite.com.“Admin account” and “Admin password” are the independent backend login credentials of the new site.newsite_com.If you are installing in a Docker environment and the main application and the new site share the same MySQL service, you can choose "database information reuse", so you do not need to re-enter the database username and password.Finally, select the template you want to use for your new site and click “OK” to complete the creation of the new site.
Configure Web Server Reverse Proxy
After creating a new site in the AnQiCMS backend, the web server (such as Nginx or Apache) also needs to be properly configured in order to correctly forward new domain requests to the running AnQiCMS application.
For example, using Baota panel, if you are using Docker deployment, you just need to add a reverse proxy site for each new domain in the "Websitehttp://127.0.0.1:8001Please note that all new site reverse proxies should point to the same port of the AnQiCMS application instance.
If you are deploying a Go project on the Baota panel instead of Docker, the steps to create a reverse proxy for each new site will be different. You may need to create a "PHP project" and set the root directory of/www/wwwroot/newsite.com/publicThen manually configure the Nginx pseudo-static rules to reverse proxy requests to the port that AnQiCMS is listening on. Specific pseudo-static rule examples are ininstall.mdThe document mentions, usually containsproxy_pass http://127.0.0.1:8001;Wait for instructions. For Apache servers, you need to configure virtual hosts and forward requests through the proxy module to the AnQiCMS port.
After completing the reverse proxy configuration, you can enter the new site domain in the browser to access and perform the initial setup or directly use the pre-configured site content. Each site will have an independent management backend, through新站点域名/system/Access is available.
Summary
The multi-site management feature of AnQiCMS provides users with an efficient and convenient solution by sharing the core application, independent data storage, and flexible Web server reverse proxy configuration.It greatly simplifies the complexity of multi-site deployment and daily maintenance, allowing you to focus on high-quality content creation and operation, thereby better attracting and retaining users.
Frequently Asked Questions (FAQ)
1. Why are the 'Site Root Directory' and 'Database Name' different in multi-site management?
The site root directory is used to store independent file resources for each site, such as cache, uploaded images, attachments, etc.Ensure each site has an independent root directory to prevent file conflicts and facilitate independent backup or migration of sites.The database name is used to store all the data for each site, including articles, categories, users, etc.Different database names can ensure that data at each site does not interfere with each other, improving data security and management independence.
2. Can I run multiple completely independent AnQiCMS applications on a single server?
Yes, this is technically feasible. You can copy the codebase and configure different ports for each copy (for example, inconfig.jsonModify the port field and set up an independent startup script and reverse proxy for each replica.In this way, each AnQiCMS application is an independent instance with no association between them.