As a website operator who is deeply familiar with the operation of AnQiCMS, I know the importance of efficient management and full utilization of the platform functions for user experience and business growth.The powerful multi-site management capability of AnQiCMS is designed to meet your needs to operate multiple websites on a single server.It can not only help you reduce O&M costs, but also realize centralized management and flexible distribution of content.

I will elaborate in detail on how to deploy and effectively manage multiple AnQiCMS sites on the same server.

The core mechanism of AnQiCMS multi-site management

One of the core advantages of AnQiCMS is its efficient multi-site management capability.This is not simply a duplicate deployment of multiple system copies on the server, but rather a single AnQiCMS application instance intelligently handles requests from different domain names and maps them to independent sites created internally by AnQiCMS.This means you only need to run one AnQiCMS process to provide services for multiple brands, product lines, or content projects, greatly simplifying server resource consumption and operation and maintenance complexity.

Each site managed by AnQiCMS has an independent database, file storage (such as cache, upload resources) and backend configuration, ensuring data isolation and business independence.The external web server (such as Nginx or Apache) plays the role of a traffic router here, routing users' requests to this unique AnQiCMS application instance based on different domain names, and then loading the corresponding site content according to the domain name within AnQiCMS.

Pre-deployment preparations

Before starting to deploy multiple AnQiCMS sites, make sure that your server environment meets the basic running requirements of AnQiCMS and that the following preparations have been made:

First, all domain names to be used on different sites must be correctly resolved to your server IP address.Next, you need a stable and reliable database service, AnQiCMS usually recommends using MySQL.Although multiple sites can share the same MySQL service, each site will have an independent database, so make sure the database user has the privileges to create and manage multiple databases.

In addition, you also need a web server as a reverse proxy, it is recommended to use Nginx or Apache.They will be responsible for receiving all external domain name requests and forwarding them to the internal port that the AnQiCMS application is listening on.

Deploy the main AnQiCMS instance

The first step in deploying multi-sites is to successfully run an AnQiCMS master instance on the server. This instance will be the base management platform for all subsequent sites.

If you choose to deploy using Docker, whether through 1Panel, aaPanel, or Baota panel, the process is more or less the same.Generally, you would pull the AnQiCMS image and create a container in Docker.8001Port. You will route requests to this Docker container through a primary domain name (for examplemain.yourdomain.com) by a reverse proxy8001Port, to complete the initialization installation and configuration of the main site.

If you choose to manually deploy on a Linux server, you need to download the AnQiCMS Linux installation package, unzip it to the specified directory, and configure a scheduled task to start and guard the AnQiCMS process, so that it runs continuously and listens to a specific port (for example,8001Similarly, configure reverse proxy for your main domain through the web server and forward the requests to127.0.0.1:8001to complete the initialization of the main site.

Ensure that the main AnQiCMS instance runs stably, and you can log in and operate through its admin interface regardless of the deployment method.

Configure the external Web server for traffic forwarding

Once the AnQiCMS main instance is on the internal port (for example8001The key is to successfully run on it, the next critical step is to forward all domain requests that need to be hosted to this port.The web server (Nginx or Apache) acts as a reverse proxy and is responsible for this task.

For each new sub-site domain, you need to create a new site configuration or virtual host in Nginx or Apache. In this configuration, you need to specify the root directory of the domain (usually pointing to the AnQiCMS installation directory under thepublicFolder), and set up reverse proxy rules to forward all HTTP/HTTPS requests for this domain to the internal address and port that the AnQiCMS application is listening on, for examplehttp://127.0.0.1:8001.

The following is an Nginx reverse proxy configuration example applicable todev.anqicms.comThis new site:

server
{
    listen       80;
    server_name dev.anqicms.com;
    # 这里的root目录应指向您为该站点创建的独立文件存储目录下的public
    # 例如:/www/wwwroot/dev.anqicms.com/public
    root /www/wwwroot/your_new_site_domain/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;
    }
    access_log /var/log/nginx/dev.anqicms.com.log; # 为新站点配置独立的访问日志
}

Please replace it according to your actual environmentdev.anqicms.comandrootPath, and ensure the web server configuration takes effect and reloads the configuration.

Add and manage new sites through the AnQiCMS backend.

After completing the configuration of the web server, the real multi-site management will be carried out in the AnQiCMS backend.

First, log in to the admin interface of the main AnQiCMS instance you have deployed. Find and click on the 'Multi-site Management' feature item in the left navigation menu.

Next, click the 'Add new site' button, and you will see a form that requires you to fill in all the details of the new site:

  • Site nameName your new site for easy identification and management in the background.
  • Site root directoryThis is a critical item. You need to specify one for each new site.Independent and uniquedirectory of the file, for example/app/your_new_site_domain_com(For Docker deployment, replace the dots in the domain name with underscores), or/www/wwwroot/your_new_site_domain/(For Baota panel or other manual deployment, it usually corresponds to the root directory in the Nginx configuration, but AnQiCMS will create its own file structure in this directory).This directory will be used to store the cache, uploaded files, and other independent data for the new site.
  • website address: Enter the complete domain name of the new site, for examplehttp://dev.anqicms.com. AnQiCMS will identify requests based on this address and load the correct site.
  • Administrator account password: Set up independent backend administration account and password for new site.
  • Database nameThe same, specify a database name for the new siteIndependent and uniqueFor exampledev_anqicms_com. AnQiCMS will store the data of the new site in this independent database.
  • Duplicate database information: Usually choose 'Reuse default database account information' because your MySQL service is already used for the AnQiCMS instance and has sufficient permissions.If you wish to use different database credentials or deploy the database at a different location, you can fill it in manually.
  • Select the template to use: Choose a suitable template for the new site. Each site can use a different template to achieve personalized display.

Fill in and confirm all information, then click the "OK" button.AnQiCMS will complete the creation and configuration of the new site in the background.At this time, by visiting the new site's domain name through the browser, you should be able to see its initial interface or the default content of the template you have selected.You can also access the management interface of the new site directly by clicking the "Access Backend" button in the multi-site management list.

Manage and optimize multi-site operations

Successfully deployed multiple AnQiCMS sites, and the management work will shift to the refined operation of each independent site.

In the AnQiCMS multi-site management list, you can easily switch to the backend of any child site and perform content creation, SEO optimization, template adjustments, and other operations.Each site has independent articles, products, categories, tags, single pages, image resources, and modules, as well as independent static rules, link push, Sitemap configuration, TDK settings, and other SEO tools.This means you can implement customized content strategies and SEO solutions for each site's specific audience and business objectives.

For example, a site can focus on publishing industry news and technical articles, while another site may be more focused on product display and online sales.AnQiCMS offers flexible content model customization features, allowing you to define exclusive content structures according to the business needs of different sites to adapt to diversified content display forms such as articles, products, events, and more.

Through AnQiCMS's traffic statistics and crawler monitoring functions, you can individually analyze the access data and search engine crawling of each site, thereby continuously optimizing content and promoting strategies.The resource storage and backup management function ensures the security and recoverability of data at each site.

Summary

The multi-site management function of AnQiCMS provides a powerful and flexible solution for small and medium-sized enterprises and content operations teams.By deploying a single AnQiCMS application instance on a server and with the help of the web server's reverse proxy and AnQiCMS's internal multi-site management mechanism, you can efficiently create, publish, manage, and optimize multiple independently operating websites.This architecture not only saves server resources and reduces the complexity of operation and maintenance, but more importantly, it gives the operation personnel greater flexibility and control in content marketing, SEO optimization, and global layout.


Frequently Asked Questions (FAQ)

Why is it recommended to manage multiple sites through a single AnQiCMS instance instead of deploying multiple independent AnQiCMS applications?

This is for the sake of efficiency and resource utilization.Each AnQiCMS application instance requires a certain amount of server memory and CPU resources.Manage multiple sites through a single instance can significantly reduce the overhead of these basic resources, especially when hosting multiple sites with low traffic, the benefit is more obvious.Moreover, centralized management also means that you only need to maintain a set of AnQiCMS application codes, simplifying the process of applying version upgrades and security patches, and reducing the complexity of overall operations.

2. Will data between different AnQiCMS sites affect or confuse each other?

Will not.AnQiCMS was designed to ensure data isolation between sites.Each child site created through the "Multi-site Management" feature has its own independent database and independent file storage directory.This means that the articles, products, user data, uploaded files of a site are stored in their respective exclusive spaces, and will not be confused or leaked with the data of other AnQiCMS sites on the server.Only by using the multi-site management feature on the backend, can you switch and manage between sites.

Can I use different domain names and design templates for each AnQiCMS sub-site?

Yes, it can be completely.The AnQiCMS multi-site management feature allows you to specify a unique domain for each sub-site and choose or modify its exclusive template when creating the site.This means you can customize the personalized website appearance and feature layout for different brands or content themes without deploying an independent CMS system, greatly enhancing the flexibility of content presentation.