Deploying multiple websites on the same server while ensuring that they run and display independently is a common requirement for many content operators.For AnQiCMS users, this is not only feasible, but also very efficient.The Anqi CMS boasts powerful multi-site management capabilities, allowing you to easily manage multiple brand sites, sub-sites, or content branches with just one core program.

Next, we will delve into how to deploy and manage multiple security CMS sites on the same server skillfully, allowing them to operate independently without interference.

Core Concept: A single program, multiple sites

The strength of Anqi CMS lies in its ability to manage multiple independent websites through a set of core programs.This means you do not need to replicate the entire Safe CMS code for each new site, but rather utilize the multisite management feature provided by the main site to create and maintain them.All sites will be served by the same security CMS application instance, but each site has its own independent backend management, database table structure (data isolation), templates, and content.This design greatly simplifies maintenance work and effectively saves server resources.

Preparation Work

Before you start deploying, you need to make some preparations:

  1. A server that has installed and is running Safe CMS:Ensure that the first security CMS site has been successfully installed on your server and can be accessed normally.This site will serve as the "main site", used for adding and managing other child sites.
  2. Multiple independent domain names:Prepare a separate domain name for each new site you want to deploy (for examplesite1.com,site2.cometc.), and resolve them to your server IP address.
  3. Server management tools:If you use the Baota panel (or 1Panel, aaPanel, etc.), the operation will be relatively simple.If you are manually configuring Nginx or Apache, you also need to ensure that you are familiar with these web server configurations.

Detailed deployment steps

The entire process is divided into two main parts: adding a new site in the AnQi CMS backend, and configuring the server's reverse proxy.

Step 1: Add a new site in the main AnQi CMS backend

Firstly, you need to log in to the management backend of your first, that is, the main security CMS site.

  1. Enter multi-site management:In the left navigation bar, find and click on the "Multi-site Management" feature. Here, the list of all added sites will be displayed.
  2. Add a new site:Click the "Add New Site" button, a configuration interface will pop up, where you need to fill in the detailed information for the new site.
    • Site Name:Choose a name for the new site that is easy to recognize, convenient for you to manage in the background.
    • Site root directory:This is a very critical setting, it defines the path where the independent data of the new site is stored. You need to specify a path for this new site.Brand new, not repeated with other sitesThe directory. For example, if your security CMS main program is deployed in/www/wwwroot/anqicms.com, you can create a new subdirectory under this directory,/www/wwwroot/anqicms.com/newsite_data。If you are deploying through Docker, the directory is usually named/app/for example/app/dev_anqicms_com。Ensure that this directory exists in the file system and that CMS has write permissions.
    • Website address:Enter the complete domain name you have prepared for the new site, for examplehttp://site2.comorhttps://www.site2.comMake sure to check it correctly, which will be the actual address for users to access the new site.
    • Administrator account and password:Set a separate management account and password for the new site. This account will be used to log in to the backend of the new site.
    • Database name:Specify aBrand new, not duplicated with other site databasesThe database name, for exampleanqicms_site2. Anqi CMS will create an independent table in this database for the new site to store data, ensuring data isolation.
    • Database information reuse:Strongly recommend checking the option "Reuse default database account information".Since all sites are served by the same security CMS program, they will use the same database connection credentials to access their respective independent databases.
    • Select the template you want to use:Select a suitable template for the new site.
  3. Confirm creation:Completed after filling in, click the “OK” button. The CMS will automatically initialize the site data in the new database and complete the background configuration.

This step has prepared the data structure of the new site and the background management.But users cannot access through the domain name because the external domain request has not been associated with the running security CMS program.

Step 2: Configure server reverse proxy

This is a key step to make your new domain point to the AnQi CMS program. Whether you are using the Baota panel or manually configuring Nginx/Apache, the core idea is to set up a 'reverse proxy' to forward the access requests of the external domain to the internal port that your AnQi CMS program is listening on (usually8001).

If you use Baota Panel or 1Panel:

  1. Create a new website:In the panel, just like creating a normal website, for your new domain name (such assite2.comCreate a website. When choosing the type of website, you can select "Static" or "Reverse Proxy".
  2. Set the running directory:Enter the settings page of the newly created website, in the "Website Directory" option, set the "Running Directory" to the main security CMS program directory under your.publicFolder. For example, if the main security CMS program is/www/wwwroot/anqicms.com, then the running directory should be set to/www/wwwroot/anqicms.com/public.
  3. Configure reverse proxy:Find the "Reverse Proxy" feature in the website settings.
    • Proxy Name:Can be filled in arbitrarily, convenient for identification.
    • Target URL:Fill in the address and port that your main security CMS program listens to. It is usually `http://127.0.0.1:800