As an experienced CMS website operation personnel in the AnQi company, I am well aware that in the increasingly fierce network environment, efficient management of multiple websites is crucial for small and medium-sized enterprises and content operation teams.AnQi CMS offers an elegant and efficient solution with its powerful multi-site management capabilities to address this pain point.Below, I will elaborate on how to install and manage multiple AnQi CMS sites on the same server.

Understanding the multi-site architecture of AnqiCMS

The AnQi CMS was designed with the need for multi-site management from the very beginning.One of its core advantages is the "multi-site management" feature, which allows users to create and independently manage multiple sites under a unified system architecture, thereby reducing redundant work and facilitating cross-site data sharing and resource integration.This means that you do not need to deploy a separate set of CMS code and runtime environment for each website, but rather manage all sub-sites through a core CMS application instance.This design greatly improves resource utilization and management efficiency.

In the multi-site architecture of AnQi CMS, each logical site has an independent database configuration, file storage path (such as cache, uploaded files, etc.), and independent front-end template and backend management permissions.Through the reverse proxy configuration of the front-end web server (such as Nginx or Apache), different domain names are pointed to the same Safe CMS application instance, and Safe CMS identifies and loads the corresponding site content based on the requested domain name.

Deploy the first AnQi CMS instance

Before starting to manage multiple sites, we first need to deploy a secure CMS core instance on the server. This instance will serve as the management center for all future sites.

You can choose any of the following methods to deploy your first AnQi CMS instance:

  1. Use the Baota panel's Go project feature (recommended)If you use Baota panel, you can conveniently deploy Anqi CMS with its 'Go project' feature. First, in/www/wwwroot/Create a directory for your main site under the directory, for exampleanqicms.comAnd upload the Linux installation package of AnQi CMS after unzipping it. Then, in the Baota panel, go to "Website" -> "Go project", click "Add Go project", and point the project executable file to the executable file of the unzipped AnQi CMS (for example/www/wwwroot/anqicms.com/anqicms),The project port is set to an unused port (for example,8001). Bind your primary domain and make sure to check "Boot up automatically". After completing the configuration, visit your primary domain and follow the instructions to complete the initialization installation of Anqi CMS.

  2. Deploy through a Docker containeranqicms/anqicms:latestImage, and deploy it on your server, exposing a container port (for example8001)。Next, create a reverse proxy site for your main domain in your control panel (1Panel/aaPanel/Baota), and proxy external requests to127.0.0.1:8001Finally, visit your main domain for initial installation.

  3. Manual deployment via command line.For users without a graphical panel or who prefer manual configuration, you can deploy on a Linux server via the command line. Download the Linux installation package of Anqi CMS and unzip it into a specified directory (such as/data/wwwroot/anqicms.com)。Configure an Nginx or Apache blockserverblock, point your main domain to the port that the secure CMS instance is listening on (for example8001Set up reverse proxy rules.At the same time, you may need to configure a scheduled task (cron job) to ensure that the security CMS can automatically start after the server restarts and continue to run.

No matter which way you choose, the key is to ensure that a secure CMS instance is running on a specific port on the server (such as 8001), and your main domain has been reverse proxied to this port via Nginx or Apache.

Configure the web server to host multiple sites

The strength of AnQi CMS lies in its ability to handle requests from different domain names through a running instance.Therefore, when you need to add a new site, the main work focuses on the configuration of the web server (Nginx/Apache).

For each new site, you need:

  1. Prepare a new domain:Make sure each new site has a unique domain name and that these domains are resolved to your server IP address.

  2. Configure Nginx/Apache reverse proxy:

    • Nginx configuration example:Add an independent one for each new domain name:serverBlock. In thisserverIn the block, the request will be reversed proxied to the port of the security CMS instance you deployed previously. For example, if your security CMS instance is running on8001Port:

      server {
          listen 80;
          server_name new-site1.com; # 您的第一个新站点域名
          root /www/wwwroot/anqicms.com/public; # 指向AnqiCMS的public目录
      
      
          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;
          }
          access_log /var/log/nginx/new-site1.com_access.log;
          error_log /var/log/nginx/new-site1.com_error.log;
      }
      
      
      server {
          listen 80;
          server_name new-site2.com; # 您的第二个新站点域名
          root /www/wwwroot/anqicms.com/public; # 同样指向AnqiCMS的public目录
      
      
          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;
          }
          access_log /var/log/nginx/new-site2.com_access.log;
          error_log /var/log/nginx/new-site2.com_error.log;
      }
      

      Please note,rootThe directive usually points to the directory under your Aanqi CMS installationpublicfolder because static files are provided from here. But actually, all dynamic requests areproxy_passforwarded to127.0.0.1:8001.

    • Apache configuration example:If you use Apache, you canVirtualHostset up reverse proxy in the configuration.

      <VirtualHost *:80>
          ServerName new-site1.com
          ProxyRequests Off
          ProxyPreserveHost On
          ProxyPass / http://127.0.0.1:8001/
          ProxyPassReverse / http://127.0.0.1:8001/
          ErrorLog ${APACHE_LOG_DIR}/new-site1.com-error.log
          CustomLog ${APACHE_LOG_DIR}/new-site1.com-access.log combined
      </VirtualHost>
      
      
      <VirtualHost *:80>
          ServerName new-site2.com
          ProxyRequests Off
          ProxyPreserveHost On
          ProxyPass / http://127.0.0.1:8001/
          ProxyPassReverse / http://127.0.0.1:8001/
          ErrorLog ${APACHE_LOG_DIR}/new-site2.com-error.log
          CustomLog ${APACHE_LOG_DIR}/new-site2.com-access.log combined
      </VirtualHost>
      

      Make sure the Apachemod_proxyandmod_proxy_httpmodule is enabled.

After configuration, make sure to restart the Nginx or Apache service to make the changes take effect.

Add and manage new sites in the Anqi CMS backend.

After the web server is configured, the new domain has already been able to point to your secure CMS instance.Next, you need to log in to the main station's Anq CMS backend to formally add and configure the new site.

  1. Log in to the main site backend:Use the administrator account you set during the first installation to log in to the backend management interface of your main AnQi CMS site (for examplehttp://anqicms.com/system/)
  2. Enter multi-site management:Find and click the "Multi-site management" feature in the left menu.
  3. Add a new site:Click the “Add new site” button, and you will see a form that requires you to fill in the details of the new site.
    • Site Name:Choose an easy name for the new site.