In the ever-changing digital age, businesses and content operators often face the challenge of managing multiple websites.AnQiCMS, an efficient content management system developed based on the Go language, is designed to address this pain point with its multi-site management feature.As an experienced website operator proficient in AnQi CMS, I am well aware of the readers' desire for efficient and convenient solutions.Today, I will elaborate on how to deploy multiple independent security CMS sites on the same physical server, helping you optimize resources and simplify management.

Embark on the journey of multiple sites: The core advantages of AnQiCMS

The AnQi CMS project is clearly positioned, aiming to become the preferred content management tool for small and medium-sized enterprises and content operation teams.One of its core highlights is the powerful "multi-site management" capability.This means you do not need to deploy a separate security CMS code for each site, but can create, manage, and maintain multiple independent content sites through a single main instance.This greatly reduces the repetitive workload, facilitates cross-site data sharing and resource integration, and can effectively utilize server resources, reducing operation and maintenance costs.Whether it is to have multiple brand sub-sites or to manage different content branches of a self-media matrix, the multi-site function of Anqi CMS can provide a simple and efficient solution.

Comprehensive preparation before deployment

Before deploying multiple security CMS sites, some basic preparations are essential.Firstly, you need a stable server. It is recommended to choose a Linux operating system, as it integrates more closely with the Go language backend of Aiqi CMS, providing better performance and security.In addition, MySQL database and reverse proxy server software such as Nginx or Apache must be installed on the server.

Domain configuration is a key link in multi-site deployment. You need to prepare a separate domain for each independent safe CMS site (for examplesite1.com,site2.com),and ensure that these domain names have been correctly resolved to your server IP address. Proper DNS configuration is a prerequisite for users to access your various websites.

Deploy multiple security CMS sites on the same server

The multi-site deployment strategy of AnQi CMS is based on a core concept: one AnQi CMS main program manages multiple front-end sites.This means that you only need to run one secure CMS binary file or Docker container, and then differentiate and manage different websites through its background features and reverse proxy configuration.

Deploy the main security CMS instance

Firstly, we need to deploy a main security CMS instance on the server. This can be achieved in two main ways:

Method one: Utilize the convenience of Baota panel or 1Panel for deployment

If you use the Baota Panel (or its international version aaPanel) or 1Panel and other visual panels, the deployment process will be simplified:

You can search and install AnQiCMS in Docker version from the app store on the panel, or directly deploy AnQiCMS binary file through the 'Go project' feature.

If you choose to deploy using Docker, please specify an internal port when creating the container (for example,8001) and the corresponding server exposed port.If you plan to run multiple independent security CMS instances in Docker (although the 'multi-site management' feature of security CMS allows a single instance to manage multiple sites, you may want to run multiple isolated Docker containers in certain specific scenarios), you need to assign a different server exposed port to each container.

After installing Docker or a Go project, configure a reverse proxy for the main security CMS instance. In the 'Website' management panel, create a reverse proxy site, and enter your main domain name (for examplemain.com)Points to the internal address and port of the AnQiCMS instance (for example127.0.0.1:8001)。This ensures that your main site can be accessed normally.

Method two: manual deployment via command line

For those who prefer manual control or in environments without a visual panel, you can choose command-line deployment:

Download the Linux installation package suitable for your server architecture from the official AnQi CMS website, and unzip it to the specified directory, for example,/www/wwwroot/anqicms-main.

Navigate to the directory after unzipping and executestart.shScript to start the AnQi CMS main program. To ensure the program runs automatically after the server restarts, it is recommended tocrontab -eadd a scheduled task, set it to check and start every minutestart.sh.

Next, you need to configure Nginx or Apache reverse proxy. For your main domain (for examplemain.com), create a new virtual host configuration. SetrootThe catalog points to the main program directory of AnQi CMS.publicfolder (for example)/www/wwwroot/anqicms-main/public), and configure reverse proxy rules to forward all requests to the listening port of the AnQiCMS instance (for examplehttp://127.0.0.1:8001)Configure completed, restart Nginx/Apache service to make changes take effect.

Add and manage multiple independent sites through the Aanqi CMS backend.

After the main AnQin CMS instance is deployed and running normally, it is the key step to add other independent sites by utilizing its powerful multi-site management function.

Log in to the backend management interface of your main AnQin CMS instance.In the left menu, you will find the "Multi-site Management" feature.Click the "Add New Site" button to start configuring your new website.

Here, you need to fill in a series of key information for the new site:.

  • Site NameIt is used for background identification and management, please fill in according to the actual situation.
  • Site Root DirectoryThis is a directory used to store independent data such as new site cache, uploaded files, etc. For Docker deployment, it usually starts with/app/for example/app/dev_anqicms.com; For manual deployment, it is a new directory on your server, for example/www/wwwroot/newsite.com. Make sure that the root directory name for each site is unique to avoid data confusion.
  • Website address: Enter the full domain name of the new site, for examplehttp://dev.anqicms.comThis domain must have been resolved to your server IP address.
  • Administrator account passwordSet up a separate admin account and password for the new site.
  • Database nameEach new site should have its own independent database to ensure complete data isolation. Please fill in a unique database name, for example,dev_anqicms_com.If you are installing via Docker and have full management permissions for the database, you can choose 'Reuse default database account information'. AnQi CMS will automatically create and configure the database for you.
  • Select the template to useSelect a suitable template for the new site.

Complete the information entry and click Confirm. Then, the Anqi CMS will create this new site instance for you in the background.

Configure the reverse proxy for the new site

The final step is to configure reverse proxy for your new site.In your Nginx or Apache configuration, add a separate virtual host or site configuration for each new domain name.http://127.0.0.1:8001).

For example, a new site configuration for Nginx might look like this:

server
{
    listen       80;
    server_name dev.anqicms.com; # 新站点的域名
    root /www/wwwroot/newsite.com/public; # 新站点的根目录(对应安企CMS后台设置的站点根目录,但此处指向其public子目录)

    location @AnqiCMS {
        proxy_pass http://127.0.0.1:8001; # 指向主安企CMS实例的端口
        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/newsite.access.log; # 独立的访问日志
}

After configuration is complete, please restart your Nginx/Apache service to make the new reverse proxy rules take effect.Here, your new site is accessible and usable via its dedicated domain.